From dc1d0da3544d2ec9adb4c792c357fe06eaf752a7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 27 Jan 2023 17:31:00 +0100 Subject: Add custom cached_label configuration for each main item --- archaeological_warehouse/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'archaeological_warehouse/models.py') diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 4fcb1b1d7..224fe8b21 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -1123,9 +1123,6 @@ class Container( ) reference = models.TextField(_("Container ref.")) comment = models.TextField(_("Comment"), blank=True, default="") - cached_label = models.TextField( - _("Localisation"), blank=True, default="", db_index=True - ) cached_location = models.TextField( _("Cached location"), blank=True, default="", db_index=True ) @@ -1309,6 +1306,9 @@ class Container( context.pop(k) def _generate_cached_label(self): + label = self._profile_generate_cached_label() + if label: + return label return self.precise_location def _generate_cached_location(self): -- cgit v1.2.3