fix: cleanup Land views to better match farmOS
This commit is contained in:
parent
e60b91fd45
commit
71592e883a
1 changed files with 20 additions and 4 deletions
|
|
@ -39,12 +39,14 @@ class LandAssetView(WuttaFarmMasterView):
|
|||
|
||||
farmos_refurl_path = "/assets/land"
|
||||
|
||||
labels = {
|
||||
"name": "Asset Name",
|
||||
}
|
||||
|
||||
grid_columns = [
|
||||
"drupal_id",
|
||||
"name",
|
||||
"land_type",
|
||||
"is_location",
|
||||
"is_fixed",
|
||||
"notes",
|
||||
"archived",
|
||||
]
|
||||
|
||||
|
|
@ -57,10 +59,11 @@ class LandAssetView(WuttaFarmMasterView):
|
|||
|
||||
form_fields = [
|
||||
"name",
|
||||
"notes",
|
||||
"asset_type",
|
||||
"land_type",
|
||||
"is_location",
|
||||
"is_fixed",
|
||||
"notes",
|
||||
"archived",
|
||||
"farmos_uuid",
|
||||
"drupal_id",
|
||||
|
|
@ -71,6 +74,9 @@ class LandAssetView(WuttaFarmMasterView):
|
|||
super().configure_grid(g)
|
||||
model = self.app.model
|
||||
|
||||
# drupal_id
|
||||
g.set_label("drupal_id", "ID", column_only=True)
|
||||
|
||||
# name
|
||||
g.set_link("name")
|
||||
|
||||
|
|
@ -89,6 +95,16 @@ class LandAssetView(WuttaFarmMasterView):
|
|||
f = form
|
||||
super().configure_form(f)
|
||||
|
||||
# notes
|
||||
f.set_widget("notes", "notes")
|
||||
|
||||
# asset_type
|
||||
if self.creating:
|
||||
f.remove("asset_type")
|
||||
else:
|
||||
f.set_default("asset_type", "Land")
|
||||
f.set_readonly("asset_type")
|
||||
|
||||
# land_type
|
||||
f.set_node("land_type", LandTypeRef(self.request))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue