diff options
-rw-r--r-- | archaeological_operations/models.py | 6 | ||||
-rw-r--r-- | archaeological_operations/templates/ishtar/sheet_site.html | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 2335155ed..b76e4841e 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -326,6 +326,12 @@ class ArchaeologicalSite(BaseHistorizedItem, OwnPerms, ValueGetter, def short_class_name(self): return _(u"SITE") + @property + def finds(self): + from archaeological_finds.models import Find + return Find.objects.filter( + base_finds__context_record__archaeological_site__pk=self.pk) + @classmethod def get_query_owns(cls, ishtaruser): from archaeological_warehouse.models import Warehouse diff --git a/archaeological_operations/templates/ishtar/sheet_site.html b/archaeological_operations/templates/ishtar/sheet_site.html index a293cb10b..7b88ff630 100644 --- a/archaeological_operations/templates/ishtar/sheet_site.html +++ b/archaeological_operations/templates/ishtar/sheet_site.html @@ -81,7 +81,16 @@ {% dynamic_table_document operations 'operations' 'archaeological_sites' item.pk '' output %} {% endif %} +{% if item.finds.count %} {% trans "Finds" as finds %} {% dynamic_table_document finds 'finds' 'base_finds__context_record__archaeological_site' item.pk '' output %} +{% endif %} + +{% trans "Documents" as docs %} +{% if permission_view_own_document or permission_view_document %} +{% if item.documents.count %} +{% dynamic_table_document docs 'documents' 'sites' item.pk '' output %} +{% endif %} +{% endif %} {% endblock %} |