diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-24 15:05:28 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-27 12:42:53 +0100 |
| commit | c682a67e79d4a2f47ff97940c377aeb4fcc4ad05 (patch) | |
| tree | 7c17d41ff47d0ec8d3061f42e37d8e0d29d8a8a2 /archaeological_warehouse/models.py | |
| parent | e6fc3223057ff1c79ad15f2f14d66dc195cffacd (diff) | |
| download | Ishtar-c682a67e79d4a2f47ff97940c377aeb4fcc4ad05.tar.bz2 Ishtar-c682a67e79d4a2f47ff97940c377aeb4fcc4ad05.zip | |
🐛 ✨ person, organization tables: fix and optimize town name and person type list (refs #6441)
Diffstat (limited to 'archaeological_warehouse/models.py')
| -rw-r--r-- | archaeological_warehouse/models.py | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index bc3015b93..9c465ebf1 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -294,10 +294,10 @@ class Warehouse( SHOW_URL = "show-warehouse" DELETE_URL = "delete-warehouse" DOWN_MODEL_UPDATE = ["containers", "responsibilities"] - TABLE_COLS = ["name", "warehouse_type__label", "cached_town_label"] + TABLE_COLS = ["name", "warehouse_type__label", "cached_town"] COL_LABELS = { "warehouse_type__label": _("Type"), - "cached_town_label": _("Town"), + "cached_town": _("Town"), } INITIAL_VALUES = ["name", "slug"] NEW_QUERY_ENGINE = True @@ -340,7 +340,7 @@ class Warehouse( DEFAULT_SEARCH_FORM = ("archaeological_warehouse.forms", "WarehouseSelect") GEO_LABEL = "name" - CACHED_LABELS = ["cached_town_label"] + CACHED_LABELS = ["cached_town"] QA_EDIT = QuickAction( url="warehouse-qa-bulk-update", @@ -433,12 +433,6 @@ class Warehouse( default=0, help_text=_("Automatically generated"), ) - cached_town_label = models.TextField( - _("Cached town label"), - blank=True, - default="", - help_text=_("Generated automatically - do not edit"), - ) SUB_ADDRESSES = ["organization", "person_in_charge"] class Meta: @@ -650,13 +644,6 @@ class Warehouse( wdiv.delete() merge_model_objects(self, item, keep_old=keep_old) - def _generate_cached_town_label(self): - if self.precise_town: - return str(self.precise_town) - if self.town: - return self.town - return "" - def check_cascade_update(self): # arbitrary check if a "location" or a "responsibility" container are impacted by a change # arbitrary because check every formula is not efficient |
