diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-21 14:20:05 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-21 14:20:05 +0200 |
commit | 7e057a2b05f99fefb0bbd9496ccb873a1fa9724b (patch) | |
tree | 5d839854faa8fbc4063ec8ec068dd9b9ce3c6af0 /archaeological_operations/models.py | |
parent | 6779a76ce977ce7dcd9afeba59dcee7f6b9da6b7 (diff) | |
download | Ishtar-7e057a2b05f99fefb0bbd9496ccb873a1fa9724b.tar.bz2 Ishtar-7e057a2b05f99fefb0bbd9496ccb873a1fa9724b.zip |
🩹 minor improvments on sheets - add getter for templates and index
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index fcfbb5e54..f4430a8f1 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -423,6 +423,7 @@ class ArchaeologicalSite( "cached_remains": "remains", "collaborators__pk": "collaborators__pk", # dynamic_table_documents "discoverer_id": "discoverer_id", # dynamic_table_documents + "types__label": "types__label", } # alternative names of fields for searches @@ -486,7 +487,7 @@ class ArchaeologicalSite( pgettext_lazy("key for text search", "comment"), "comment__iexact" ), "precise_locality": SearchAltName( - pgettext_lazy("key for text search", "locality"), "precise_locality__iexact" + pgettext_lazy("key for text search", "address"), "precise_locality__iexact" ), "locality_ngi": SearchAltName( pgettext_lazy("key for text search", "locality-ngi"), "locality_ngi__iexact" @@ -627,7 +628,7 @@ class ArchaeologicalSite( comment = models.TextField(_("Comment"), blank=True, default="") description = models.TextField(_("Description"), blank=True, default="") public_description = models.TextField(_("Public description"), blank=True, default="") - precise_locality = models.TextField(_("Precise locality"), blank=True, default="") + precise_locality = models.TextField(_("Address"), blank=True, default="") locality_ngi = models.TextField( _("National Geographic Institute locality"), blank=True, default="" ) @@ -717,6 +718,18 @@ class ArchaeologicalSite( return self.top_operations.all()[0] return + @property + def rendered_towns_list(self): + return ", ".join([str(town) for town in self.towns.all()]) + + @property + def rendered_types_list(self): + return ", ".join([typ.label for typ in self.types.all()]) + + @property + def rendered_periods_list(self): + return ", ".join([period.label for period in self.periods.all()]) + def public_representation(self): dct = super(ArchaeologicalSite, self).public_representation() dct.update( |