summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py17
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(