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_finds/data_importer.py | 8 ++-- archaeological_finds/models.py | 3 +- .../templates/ishtar/sheet_find.html | 44 ++++++++++++++++++---- 3 files changed, 42 insertions(+), 13 deletions(-) (limited to 'archaeological_finds') 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 @@ {% endif%} -

-{{item.label}}

+{% if item.label %}

+{{item.label}}

{% endif %} {% if item.description %}

{{item.description}}

{% endif%}

{{ item.history_creator.ishtaruser.full_label }}

{{item.material_type}}

-

-{{item.dating}}

+{% if item.dating %}

+{{item.dating}}

{% endif %} {% if item.volume %}

{{item.volume}}

{% endif%} -{% if item.weight %}

-{{item.weight}}

{% endif%} +{% if item.weight %}

+{{item.weight}} {% if item.weight_unit %}{{item.weight_unit}}{% else %}g{% endif %}

{% endif%} {% if item.find_number %}

{{item.find_number}}

{% endif%} + +{% if item.conservatory_state %} +

+{{item.conservatory_state}}

+{% endif %} +{% if item.preservation_to_consider %} +

+{{item.preservation_to_consider}}

+{% endif %} + {% if item.upstream_treatment %}

-{{item.upstream_treatment}}

{% endif%} +{{item.upstream_treatment}} ({% for up in item.upstream_treatment.upstream_treatment.all %}{% if forloop.counter0 %}, {%endif %}{{up}}{% endfor %})

{% endif%} {% if item.downstream_treatment %}

-{{item.downstream_treatment}}

{% endif%} +{{item.downstream_treatment}} ({% for dt in item.downstream_treatment.downstream_treatment.all %}{% if forloop.counter0 %}, {%endif %}{{dt}}{% endfor %})

{% endif%} {% if item.container %}

{{item.container}}

{% endif%} @@ -55,6 +65,24 @@ {% for base_find in item.base_finds.all %}

{{base_find.complete_id}}

+ +{% if base_find.discovery_date %} +

+{{base_find.discovery_date}}

+{% endif%} +{% if base_find.description %} +

+{{base_find.description}}

+{% endif%} +{% if base_find.comment %} +

+{{base_find.comment}}

+{% endif%} +{% if base_find.special_interest %} +

+{{base_find.special_interest}}

+{% endif%} +

{{ base_find.context_record }}

-- cgit v1.2.3