diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-01-29 02:14:03 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-01-29 02:14:03 +0100 |
commit | e76c7fe40248300204f44417653b39ab9bc9d4a1 (patch) | |
tree | f6289016093b1830070861cdc4acc605a19fb8d5 /archaeological_finds | |
parent | c7d253fc94038cd3eb20e190581eff3b461e463b (diff) | |
download | Ishtar-e76c7fe40248300204f44417653b39ab9bc9d4a1.tar.bz2 Ishtar-e76c7fe40248300204f44417653b39ab9bc9d4a1.zip |
Add new fields to context record, find sheets.
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/data_importer.py | 8 | ||||
-rw-r--r-- | archaeological_finds/models.py | 3 | ||||
-rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find.html | 44 |
3 files changed, 42 insertions, 13 deletions
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> |