fix: improve handling of 'archived' records for grid/form views

This commit is contained in:
Lance Edgar 2026-02-14 19:31:36 -06:00
parent 25b2dc6cec
commit e120812eae
4 changed files with 27 additions and 0 deletions

View file

@ -52,6 +52,7 @@ class LandAssetView(WuttaFarmMasterView):
filter_defaults = {
"name": {"active": True, "verb": "contains"},
"archived": {"active": True, "verb": "is_false"},
}
form_fields = [
@ -78,6 +79,12 @@ class LandAssetView(WuttaFarmMasterView):
g.set_sorter("land_type", model.LandType.name)
g.set_filter("land_type", model.LandType.name, label="Land Type Name")
def grid_row_class(self, land, data, i):
""" """
if land.archived:
return "has-background-warning"
return None
def configure_form(self, form):
f = form
super().configure_form(f)