diff options
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 |
commit | 326f81f1a61cc91587aa92fd6793045d2f2c139c (patch) | |
tree | 88d1959cc1d096bd6d318623850b24310865eab8 /archaeological_operations/data_importer.py | |
parent | 026274e37f85b12133627f576aad3d2a242144af (diff) | |
download | Ishtar-326f81f1a61cc91587aa92fd6793045d2f2c139c.tar.bz2 Ishtar-326f81f1a61cc91587aa92fd6793045d2f2c139c.zip |
Importer: manage many values in one field
Diffstat (limited to 'archaeological_operations/data_importer.py')
-rw-r--r-- | archaeological_operations/data_importer.py | 19 |
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 |