summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_context_records/data_importer.py2
-rw-r--r--archaeological_context_records/models.py4
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecord.html27
-rw-r--r--archaeological_finds/data_importer.py8
-rw-r--r--archaeological_finds/models.py3
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html44
6 files changed, 72 insertions, 16 deletions
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 %}<p><label>{% trans "TPQ estimated:" %}</label> <span class='value'>{{ item.tpq_estimated }}</span></p>{%endif%}
{%endif%}
+{% if item.right_relations.count %}
+<h3>{% trans "In relation with"%}</h3>
+<table>
+ <tr>
+ <th>{% trans "Relation type" %}</th>
+ <th>{% trans "ID" %}</th>
+ <th>{% trans "Type" %}</th>
+ <th>{% trans "Chronology" %}</th>
+ <th>{% trans "Description" %}</th>
+ <th>{% trans "Parcel" %}</th>
+ <th class='link'>&nbsp;</th>
+ </tr>
+ {% for relation in item.right_relations.all %}
+ <tr>
+ <td class='string'>{{ relation.relation_type }}</td>
+ <td class='string'>{{ relation.right_record.label }}</td>
+ <td class='string'>{{relation.right_record.unit|default:""}}</td>
+ <td class='string'>{{ relation.right_record.datings.all|join:", " }}</td>{# periods ?#}
+ <td class='string'>{{ relation.right_record.description }}</td>
+ <td class='string'>{{ relation.right_record.parcel.section }} - {{relation.right_record.parcel.parcel_number}}</td>
+ <td class='link'><a href="#" class='display_details' onclick='load_window("{%url show-contextrecord relation.right_record.pk ''%}")'>{% trans "Details" %}</a></td>
+ </tr>
+ {% endfor %}
+<table>
+
+{% endif %}
+
{% if item.operation %}
<h3>{% trans "Operation resume"%}</h3>
<p><label>{%trans "Year:"%}</label> <span class='value'>{{ item.operation.year }}</span></p>
diff --git a/archaeological_finds/data_importer.py b/archaeological_finds/data_importer.py
index cfcce7178..429cd4beb 100644
--- a/archaeological_finds/data_importer.py
+++ b/archaeological_finds/data_importer.py
@@ -37,7 +37,7 @@ class FindsImporterBibracte(Importer):
IntegerFormater(),),
# external_id
ImportFormater('external_id', UnicodeFormater(120, notnull=True),
- duplicate_fields=['find__external_id']),
+ duplicate_fields=['find__external_id', 'label', 'find__label']),
# isolé ou non (si non isolé = lot)
ImportFormater('is_isolated', StrToBoolean(
choices={'lot':False, 'objet':True}), required=False),
@@ -76,8 +76,9 @@ class FindsImporterBibracte(Importer):
# comment
ImportFormater('comment', UnicodeFormater(1000), required=False),
# lien vers plusieurs chrono (voir gestion actuelle chrono)
- ImportFormater('find__dating__period', TypeFormater(Period,
- many_split="&"), required=False),
+ None,
+ #ImportFormater('find__dating__period', TypeFormater(Period,
+ # many_split="&"), required=False),
# topographic_localisation
ImportFormater('topographic_localisation', UnicodeFormater(120),
required=False),
@@ -90,7 +91,6 @@ class FindsImporterBibracte(Importer):
None
]
-
class FindAltImporterBibracte(Importer):
DESC = u"Exports Bibracte : importeur pour l'onglet prélèvement"
OBJECT_CLS = models.BaseFind
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index 7d5b3108d..1fb92f9d8 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -108,8 +108,9 @@ class BaseFind(BaseHistorizedItem, OwnPerms):
return
find = self.get_last_find()
ope = self.context_record.operation
- c_id = [unicode(ope.code_patriarche) or \
+ c_id = [unicode(ope.code_patriarche) if ope.code_patriarche else
(unicode(ope.year) + "-" + unicode(ope.operation_code))]
+ print c_id
c_id.append(find and find.material_type.code or '')
c_id.append(self.context_record.label)
c_id.append(unicode(self.index))
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index 0e5ddfac0..c5bd637a5 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -28,25 +28,35 @@
<a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}"><img src='{{item.thumbnail.url}}'/></a>
{% endif%}
-<p><label>{%trans "Name"%}{% trans ":"%}</label>
-<span class='value'>{{item.label}}</span></p>
+{% if item.label %}<p><label>{%trans "Name"%}{% trans ":"%}</label>
+<span class='value'>{{item.label}}</span></p>{% endif %}
{% if item.description %}<p><label>{%trans "Description"%}{% trans ":"%}</label>
<span class='value'>{{item.description}}</span></p>{% endif%}
<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p>
<p><label>{%trans "Material type"%}{% trans ":"%}</label>
<span class='value'>{{item.material_type}}</span></p>
-<p><label>{%trans "Dating"%}{% trans ":"%}</label>
-<span class='value'>{{item.dating}}</span></p>
+{% if item.dating %}<p><label>{%trans "Dating"%}{% trans ":"%}</label>
+<span class='value'>{{item.dating}}</span></p>{% endif %}
{% if item.volume %}<p><label>{%trans "Volume (l)"%}{% trans ":"%}</label>
<span class='value'>{{item.volume}}</span></p>{% endif%}
-{% if item.weight %}<p><label>{%trans "Weight (g)"%}{% trans ":"%}</label>
-<span class='value'>{{item.weight}}</span></p>{% endif%}
+{% if item.weight %}<p><label>{%trans "Weight"%}{% trans ":"%}</label>
+<span class='value'>{{item.weight}} {% if item.weight_unit %}{{item.weight_unit}}{% else %}g{% endif %}</span></p>{% endif%}
{% if item.find_number %}<p><label>{%trans "Find number"%}{% trans ":"%}</label>
<span class='value'>{{item.find_number}}</span></p>{% endif%}
+
+{% if item.conservatory_state %}
+<p><label>{%trans "Conservatory state"%}{% trans ":"%}</label>
+<span class='value'>{{item.conservatory_state}}</span></p>
+{% endif %}
+{% if item.preservation_to_consider %}
+<p><label>{%trans "Type of preservation to consider"%}{% trans ":"%}</label>
+<span class='value'>{{item.preservation_to_consider}}</span></p>
+{% endif %}
+
{% if item.upstream_treatment %}<p><label>{%trans "Upstream treatment"%}{% trans ":"%}</label>
-<span class='value'>{{item.upstream_treatment}}</span></p>{% endif%}
+<span class='value'>{{item.upstream_treatment}} ({% for up in item.upstream_treatment.upstream_treatment.all %}{% if forloop.counter0 %}, {%endif %}{{up}}{% endfor %})</span></p>{% endif%}
{% if item.downstream_treatment %}<p><label>{%trans "Downstream treatment"%}{% trans ":"%}</label>
-<span class='value'>{{item.downstream_treatment}}</span></p>{% endif%}
+<span class='value'>{{item.downstream_treatment}} ({% for dt in item.downstream_treatment.downstream_treatment.all %}{% if forloop.counter0 %}, {%endif %}{{dt}}{% endfor %})</span></p>{% endif%}
{% if item.container %}<p><label>{%trans "Container"%}{% trans ":"%}</label>
<span class='value'>{{item.container}}</span></p>{% endif%}
@@ -55,6 +65,24 @@
{% for base_find in item.base_finds.all %}
<p><label>{%trans "Complete ID"%}{% trans ":"%}</label>
<span class='value'>{{base_find.complete_id}}</span></p>
+
+{% if base_find.discovery_date %}
+<p><label>{%trans "Discovery date"%}{% trans ":"%}</label>
+<span class='value'>{{base_find.discovery_date}}</span></p>
+{% endif%}
+{% if base_find.description %}
+<p><label>{%trans "Description"%}{% trans ":"%}</label>
+<span class='value'>{{base_find.description}}</span></p>
+{% endif%}
+{% if base_find.comment %}
+<p><label>{%trans "Comment"%}{% trans ":"%}</label>
+<span class='value'>{{base_find.comment}}</span></p>
+{% endif%}
+{% if base_find.special_interest %}
+<p><label>{%trans "Special interest"%}{% trans ":"%}</label>
+<span class='value'>{{base_find.special_interest}}</span></p>
+{% endif%}
+
<p><label>{%trans "Related context record"%}{% trans ":"%}</label>
<span class='value'><a href="#" onclick='load_window("{% url show-contextrecord base_find.context_record.pk ''%}");'>{{ base_find.context_record }}</a></span></p>
<p><label>{%trans "Related parcel"%}{% trans ":"%}</label>