From 399b48288a2eda31dce54b64f2baf7494a675f37 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 29 Jan 2015 02:14:03 +0100 Subject: Add new fields to context record, find sheets. --- archaeological_context_records/data_importer.py | 2 +- archaeological_context_records/models.py | 4 ++-- .../templates/ishtar/sheet_contextrecord.html | 27 ++++++++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) (limited to 'archaeological_context_records') diff --git a/archaeological_context_records/data_importer.py b/archaeological_context_records/data_importer.py index 0d04678c5..0bf6f83a1 100644 --- a/archaeological_context_records/data_importer.py +++ b/archaeological_context_records/data_importer.py @@ -35,7 +35,7 @@ class ContextRecordsImporterBibracte(Importer): ImportFormater('operation__operation_code', IntegerFormater(), duplicate_fields=['parcel__operation__operation_code'],), # ID UE - ImportFormater('external_id', UnicodeFormater(120),), + ImportFormater('external_id', UnicodeFormater(120), duplicate_fields=['label'],), # Type ImportFormater('unit', TypeFormater(models.Unit), required=False), # description diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 6a08e2f84..81d395ced 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -284,9 +284,9 @@ class RelationType(GeneralType): class RecordRelations(models.Model): left_record = models.ForeignKey(ContextRecord, - related_name='left_relations') + related_name='right_relations') right_record = models.ForeignKey(ContextRecord, - related_name='right_relations') + related_name='left_relations') relation_type = models.ForeignKey(RelationType) class Meta: diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index 308c20289..1a18f1cd5 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -64,6 +64,33 @@ {% if item.tpq_estimated %}

{{ item.tpq_estimated }}

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

{% trans "In relation with"%}

+ + + + + + + + + + + {% for relation in item.right_relations.all %} + + + + + {# periods ?#} + + + + + {% endfor %} +
{% trans "Relation type" %}{% trans "ID" %}{% trans "Type" %}{% trans "Chronology" %}{% trans "Description" %}{% trans "Parcel" %} 
{{ relation.relation_type }}{{ relation.right_record.label }}{{relation.right_record.unit|default:""}}{{ relation.right_record.datings.all|join:", " }}{{ relation.right_record.description }}{{ relation.right_record.parcel.section }} - {{relation.right_record.parcel.parcel_number}}
+ +{% endif %} + {% if item.operation %}

{% trans "Operation resume"%}

{{ item.operation.year }}

-- cgit v1.2.3