diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-01-27 15:26:09 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-01-27 15:26:09 +0100 |
commit | 4b8571e492a342314c6a68dbb80b5c48f76ffd4e (patch) | |
tree | 70d2aa4499630be5305124b5f3f940c9b9c7b45f /archaeological_operations/data_importer.py | |
parent | 97a7791ace5e6706f88d163c23a1f2ad6746eb9c (diff) | |
download | Ishtar-4b8571e492a342314c6a68dbb80b5c48f76ffd4e.tar.bz2 Ishtar-4b8571e492a342314c6a68dbb80b5c48f76ffd4e.zip |
Bibracte import for context records.
Diffstat (limited to 'archaeological_operations/data_importer.py')
-rw-r--r-- | archaeological_operations/data_importer.py | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/archaeological_operations/data_importer.py b/archaeological_operations/data_importer.py index ebcc039d0..6b7c390cd 100644 --- a/archaeological_operations/data_importer.py +++ b/archaeological_operations/data_importer.py @@ -146,7 +146,6 @@ RE_CD_POSTAL_FILTER = re.compile("(\d*) (\d*)") RE_ORGA = re.compile("([^,]*)") - class OperationImporterBibracte(Importer): DESC = u"Exports Bibracte : importeur pour l'onglet opération" DEFAULTS = { @@ -177,3 +176,48 @@ class OperationImporterBibracte(Importer): OBJECT_CLS = models.Operation + +RE_PARCEL_SECT_NUM = re.compile("([A-Za-z]*)([0-9]*)") +RE_NUM_INSEE = re.compile("([0-9]*)") + +class ParcelImporterBibracte(Importer): + + OBJECT_CLS = models.Parcel + + DESC = u"Exports Bibracte : importeur pour l'onglet parcelles" + DEFAULTS = { + ('operator',):{ + 'organization_type':OrganizationType.objects.get( + txt_idx="operator")}, + } + LINE_FORMAT = [ + # 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_field='external_id',), + ImportFormater('external_id', + UnicodeFormater(12), + required=False,), + # numero parcelle + ImportFormater('parcel_number', UnicodeFormater(6), + required=False,), + # section cadastre + ImportFormater('section', UnicodeFormater(4), + required=False,), + # annee cadastre + ImportFormater('year', YearFormater(), required=False,), + # nom commune + None, + # numero INSEE commune + ImportFormater('town__numero_insee', UnicodeFormater(6), + regexp=RE_NUM_INSEE, required=False,), + # nom departement + None, + # lieu dit adresse + ImportFormater('address', UnicodeFormater(500), + required=False,), + ] |