summaryrefslogtreecommitdiff
path: root/archaeological_operations/data_importer.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-01-26 13:57:43 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-01-26 13:57:43 +0100
commit248505a3a2a0343153b698aecfb358f2b29b766d (patch)
tree88d1959cc1d096bd6d318623850b24310865eab8 /archaeological_operations/data_importer.py
parentb13324f20479de7603ed5daa9e3d989fc9bd4bd5 (diff)
downloadIshtar-248505a3a2a0343153b698aecfb358f2b29b766d.tar.bz2
Ishtar-248505a3a2a0343153b698aecfb358f2b29b766d.zip
Importer: manage many values in one field
Diffstat (limited to 'archaeological_operations/data_importer.py')
-rw-r--r--archaeological_operations/data_importer.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/archaeological_operations/data_importer.py b/archaeological_operations/data_importer.py
index 4402c8b17..e02b53df0 100644
--- a/archaeological_operations/data_importer.py
+++ b/archaeological_operations/data_importer.py
@@ -148,22 +148,31 @@ RE_ORGA = re.compile("([^,]*)")
class OperationImporterBibracte(Importer):
+ DEFAULTS = {
+ ('in_charge',):{
+ 'organization_type':OrganizationType.objects.get(
+ txt_idx="operator")},
+ }
LINE_FORMAT = [
# CODE OPE
- ImportFormater('operation_code',
- IntegerFormater(),),
+ ImportFormater('operation_code', IntegerFormater(),),
# REGION
None,
# TYPE operation
- ImportFormater('operation_type',
- TypeFormater(models.OperationType),),
-
+ ImportFormater('operation_type', TypeFormater(models.OperationType),),
# NOM
+ ImportFormater('common_name', UnicodeFormater(120),),
# OPERATEUR
+ ImportFormater('operator__name', UnicodeFormater(120),),
# resp. lien IMPORT avec personne
+ ImportFormater('in_charge__raw_name', UnicodeFormater(300),),
# début
+ ImportFormater('start_date', DateFormater('%Y/%m/%d'),),
# fin
+ ImportFormater('excavation_end_date', DateFormater('%Y/%m/%d'),),
# Chronos
+ ImportFormater('periods', TypeFormater(models.Period, many=True),
+ many=True),
]
OBJECT_CLS = models.Operation