summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-01-29 00:43:20 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-01-29 00:43:20 +0100
commite5f4fd5bc800695d335456ca2103fbbe650ce890 (patch)
tree48605e15c495926db24b34a9926a05d19ce3cfbd
parent61a55f5f530f5d5f974218f88015ff4c0ac191cc (diff)
downloadIshtar-e5f4fd5bc800695d335456ca2103fbbe650ce890.tar.bz2
Ishtar-e5f4fd5bc800695d335456ca2103fbbe650ce890.zip
Fix Bibratce Import - Fix context record window
-rw-r--r--archaeological_context_records/data_importer.py7
-rw-r--r--archaeological_context_records/models.py4
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecord.html3
-rw-r--r--archaeological_operations/data_importer.py13
4 files changed, 15 insertions, 12 deletions
diff --git a/archaeological_context_records/data_importer.py b/archaeological_context_records/data_importer.py
index bbe89a5b8..0d04678c5 100644
--- a/archaeological_context_records/data_importer.py
+++ b/archaeological_context_records/data_importer.py
@@ -55,9 +55,10 @@ class ContextRecordsImporterBibracte(Importer):
ImportFormater('comment', UnicodeFormater(1000), required=False,),
# ????
None,
- # chrono
- ImportFormater('dating__period', TypeFormater(models.Period,
- many_split="&"), required=False),
+ # chrono #TODO! pas de vrai création de nouvelle et en cas de modif
+ # c'est la zone
+ ImportFormater('datings__period', TypeFormater(models.Period),
+ required=False),
]
class ContextRecordsRelationImporterBibracte(Importer):
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index a94421ada..6a08e2f84 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -158,6 +158,10 @@ class ContextRecord(BaseHistorizedItem, OwnPerms, ShortMenuItem):
)
@property
+ def name(self):
+ return self.label or ""
+
+ @property
def short_class_name(self):
return pgettext("short", u"Context record")
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
index acc0db718..308c20289 100644
--- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
@@ -38,10 +38,11 @@
<p><label>{% trans "Place:" %}</label> <span class='value'>{{ item.parcel.town }}</span></p>
<p><label>{% trans "Parcel:" %}</label> <span class='value'>{{ item.parcel.short_label }}</span></p>
-{% if item.description or item.lenght or item.width or item.depth %}
+{% if item.description or item.lenght or item.width or item.depth or item.comment %}
<h3>{% trans "Description"%}</h3>
<p><label>{% trans "Description:" %}</label> <span class='value'>{{ item.description }}</span></p>
+{% if item.comment %}<p><label>{% trans "Comment:" %}</label> <span class='value'>{{ item.comment }}</span></p>{% endif %}
{% if item.lenght %}<p><label>{% trans "Length (cm):" %}</label> <span class='value'>{{ item.length }}</span></p>{%endif%}
{% if item.width %}<p><label>{% trans "Width (cm):" %}</label> <span class='value'>{{ item.width }}</span></p>{%endif%}
{% if item.depth %}<p><label>{% trans "Depth (cm):" %}</label> <span class='value'>{{ item.depth }}</span></p>{%endif%}
diff --git a/archaeological_operations/data_importer.py b/archaeological_operations/data_importer.py
index c1fd99fe1..2c016b588 100644
--- a/archaeological_operations/data_importer.py
+++ b/archaeological_operations/data_importer.py
@@ -192,14 +192,11 @@ class ParcelImporterBibracte(Importer):
# code OA
ImportFormater('operation__operation_code', IntegerFormater(),),
# identifiant parcelle
- #ImportFormater(['section', 'parcel_number'],
- # [UnicodeFormater(4), UnicodeFormater(6),],
- # regexp=RE_PARCEL_SECT_NUM,
- # regexp_formater_args=[0, 1], required=False,
- # duplicate_fields=['external_id'],),
- ImportFormater('external_id',
- UnicodeFormater(12),
- required=False,),
+ ImportFormater(['section', 'parcel_number'],
+ [UnicodeFormater(4), UnicodeFormater(6),],
+ regexp=RE_PARCEL_SECT_NUM,
+ regexp_formater_args=[[0], [1]], required=False,
+ duplicate_fields=['external_id'],),
# numero parcelle
ImportFormater('parcel_number', UnicodeFormater(6),
required=False,),