From 09b87ba5e8f84b4d012d7472ac4841f818b606a5 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 18 Dec 2015 19:32:54 +0100 Subject: Operations: display relations in sheet files --- archaeological_operations/models.py | 1 + .../templates/ishtar/sheet_operation.html | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 58281250f..90215b4c6 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -467,6 +467,7 @@ class RecordRelations(GeneralRecordRelations, models.Model): class Meta: verbose_name = _(u"Operation record relation") verbose_name_plural = _(u"Operation record relations") + ordering = ('left_record', 'relation_type') post_delete.connect(post_delete_record_relation, sender=RecordRelations) diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 545b1c143..0435022c1 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -93,6 +93,17 @@

{{ item.altitude }}

{% endcomment %} +{% if item.right_relations.count %} +

{% trans "Relations"%}

+{% for rel in item.right_relations.all %} +{% ifchanged rel.relation_type %} +{% if forloop.counter0 %}{% endif %} +

{{rel.relation_type}}

{% endif %} +{% endfor %} +{% endif %} + {% trans "Associated parcels" as parcels_label %} {% include "ishtar/blocks/window_tables/parcels.html" %} -- cgit v1.2.3