diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2015-05-13 10:41:18 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2015-05-13 10:41:18 +0200 | 
| commit | 7ad2fce4c7158c46629fd1c1c4c85c739a392289 (patch) | |
| tree | 3717afa30a804a4cdb9e0ad810071f6a3a014b8d | |
| parent | dcf9531c22d4d99da242512dba9f82122fbdd8ad (diff) | |
| download | Ishtar-7ad2fce4c7158c46629fd1c1c4c85c739a392289.tar.bz2 Ishtar-7ad2fce4c7158c46629fd1c1c4c85c739a392289.zip | |
Fixtures in Makefile. Update initial_importtypes-fr.
| -rw-r--r-- | Makefile.example | 64 | ||||
| -rwxr-xr-x | example_project/dump_initial_data.sh | 41 | ||||
| -rwxr-xr-x | example_project/generate_fixture.sh | 3 | ||||
| -rw-r--r-- | ishtar_common/fixtures/initial_importtypes-fr.json | 502 | 
4 files changed, 559 insertions, 51 deletions
| diff --git a/Makefile.example b/Makefile.example index 82f2a42e3..be9dbdedf 100644 --- a/Makefile.example +++ b/Makefile.example @@ -96,3 +96,67 @@ generate_doc:  	$(PYTHON) manage.py graph_models --pydot -I "ImporterType,ImporterDefault,ImporterDefaultValues,ImporterColumn,Regexp,ImportTarget,FormaterType,Import" ishtar_common > /tmp/ishtar.dot  	dot -Tpng /tmp/ishtar.dot -o docs/source/_static/db-imports.png  	rm /tmp/ishtar.dot + +fixtures: fixtures_common fixtures_operations fixtures_archaeological_context_records fixtures_archaeological_finds fixtures_archaeological_warehouse fixtures_archaeological_files + +fixtures_common: fixtures_common_importers +	cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ +							ishtar_common.authortype \ +							ishtar_common.persontype \ +							ishtar_common.organizationtype \ +							ishtar_common.sourcetype \ +	   > '../ishtar_common/fixtures/initial_data-'$(default_data)'.json' + +fixtures_common_importers: +	cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ +							ishtar_common.importertype \ +							ishtar_common.importerdefault \ +							ishtar_common.importerdefaultvalues \ +							ishtar_common.importercolumn \ +							ishtar_common.importtarget \ +							ishtar_common.formatertype \ +	   > '../ishtar_common/fixtures/initial_importtypes-'$(default_data)'.json' + +fixtures_initial_data: +	cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ +							ishtar_common.authortype \ +							ishtar_common.persontype \ +							ishtar_common.organizationtype \ +							ishtar_common.sourcetype \ +	   > '../ishtar_common/fixtures/initial_data-'$(default_data)'.json' + +fixtures_operations: +	cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ +							archaeological_operations.acttype \ +							archaeological_operations.operationtype \ +							archaeological_operations.period \ +							archaeological_operations.remaintype \ +	   > '../archaeological_operations/fixtures/initial_data-'$(default_data)'.json' + +fixtures_context_records: +	cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ +							archaeological_context_records.datingquality \ +							archaeological_context_records.activitytype \ +							archaeological_context_records.identificationtype \ +							archaeological_context_records.unit \ +							archaeological_context_records.datingtype \ +	   > '../archaeological_context_records/fixtures/initial_data-'$(default_data)'.json' + +fixtures_finds: +	cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ +							archaeological_finds.materialtype \ +							archaeological_finds.treatmenttype \ +	   > '../archaeological_finds/fixtures/initial_data-'$(default_data)'.json' + +fixtures_warehouse: +	cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ +							archaeological_warehouse.containertype \ +							archaeological_warehouse.warehousetype \ +	   > '../archaeological_warehouse/fixtures/initial_data-'$(default_data)'.json' + +fixtures_files: +	cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ +							archaeological_files.saisinetype \ +							archaeological_files.filetype \ +							archaeological_files.permittype \ +	   > '../archaeological_files/fixtures/initial_data-'$(default_data)'.json' diff --git a/example_project/dump_initial_data.sh b/example_project/dump_initial_data.sh deleted file mode 100755 index ad5b38211..000000000 --- a/example_project/dump_initial_data.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -SUFFIX='-fr' - -python ./manage.py dumpdata --indent 4 \ -                        ishtar_common.authortype \ -                        ishtar_common.persontype \ -                        ishtar_common.organizationtype \ -                        ishtar_common.sourcetype \ -   > '../ishtar_common/fixtures/initial_data'$SUFFIX'.json' - -python ./manage.py dumpdata --indent 4 \ -                        archaeological_operations.acttype \ -                        archaeological_operations.operationtype \ -                        archaeological_operations.period \ -                        archaeological_operations.remaintype \ -   > '../archaeological_operations/fixtures/initial_data'$SUFFIX'.json' - -python ./manage.py dumpdata --indent 4 \ -                        archaeological_context_records.datingquality \ -                        archaeological_context_records.activitytype \ -                        archaeological_context_records.identificationtype \ -                        archaeological_context_records.unit \ -                        archaeological_context_records.datingtype \ -   > '../archaeological_context_records/fixtures/initial_data'$SUFFIX'.json' - -python ./manage.py dumpdata --indent 4 \ -                        archaeological_finds.materialtype \ -                        archaeological_finds.treatmenttype \ -   > '../archaeological_finds/fixtures/initial_data'$SUFFIX'.json' - -python ./manage.py dumpdata --indent 4 \ -                        archaeological_warehouse.containertype \ -                        archaeological_warehouse.warehousetype \ -   > '../archaeological_warehouse/fixtures/initial_data'$SUFFIX'.json' - -python ./manage.py dumpdata --indent 4 \ -                        archaeological_files.saisinetype \ -                        archaeological_files.filetype \ -                        archaeological_files.permittype \ -   > '../archaeological_files/fixtures/initial_data'$SUFFIX'.json' diff --git a/example_project/generate_fixture.sh b/example_project/generate_fixture.sh deleted file mode 100755 index a69a9c836..000000000 --- a/example_project/generate_fixture.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -echo "Generate initial_data" -./manage.py dumpdata --indent 1 ishtar_base.OrganizationType ishtar_base.PersonType ishtar_base.AuthorType ishtar_base.SourceType ishtar_base.FileType ishtar_base.PermitType ishtar_base.SaisineType ishtar_base.OperationType ishtar_base.RemainType ishtar_base.Period  ishtar_base.DatingType ishtar_base.DatingQuality ishtar_base.Unit ishtar_base.ActivityType ishtar_base.IdentificationType ishtar_base.MaterialType ishtar_base.WarehouseType ishtar_base.ActType ishtar_base.ContainerType ishtar_base.TreatmentType > fixtures/initial_data.json && echo "Done" diff --git a/ishtar_common/fixtures/initial_importtypes-fr.json b/ishtar_common/fixtures/initial_importtypes-fr.json index a848b945f..77935731f 100644 --- a/ishtar_common/fixtures/initial_importtypes-fr.json +++ b/ishtar_common/fixtures/initial_importtypes-fr.json @@ -11,6 +11,28 @@          }      },       { +        "pk": 2,  +        "model": "ishtar_common.importertype",  +        "fields": { +            "users": [],  +            "is_template": true,  +            "name": "Bibracte - Parcelles",  +            "associated_models": "archaeological_operations.models.Parcel",  +            "description": "" +        } +    },  +    { +        "pk": 3,  +        "model": "ishtar_common.importertype",  +        "fields": { +            "users": [],  +            "is_template": true,  +            "name": "Bibracte - Documentation",  +            "associated_models": "archaeological_operations.models.OperationSource",  +            "description": "" +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.importerdefault",           "fields": { @@ -19,6 +41,14 @@          }      },       { +        "pk": 2,  +        "model": "ishtar_common.importerdefault",  +        "fields": { +            "importer_type": 3,  +            "target": "authors" +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.importerdefaultvalues",           "fields": { @@ -28,6 +58,15 @@          }      },       { +        "pk": 2,  +        "model": "ishtar_common.importerdefaultvalues",  +        "fields": { +            "default_target": 2,  +            "target": "author_type",  +            "value": "main_author" +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.importercolumn",           "fields": { @@ -108,6 +147,176 @@          }      },       { +        "pk": 9,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 1,  +            "required": true,  +            "importer_type": 2,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 10,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 2,  +            "required": true,  +            "importer_type": 2,  +            "regexp_pre_filter": 1 +        } +    },  +    { +        "pk": 11,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 5,  +            "required": false,  +            "importer_type": 2,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 12,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 7,  +            "required": false,  +            "importer_type": 2,  +            "regexp_pre_filter": 2 +        } +    },  +    { +        "pk": 13,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 9,  +            "required": false,  +            "importer_type": 2,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 14,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 1,  +            "required": true,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 15,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 2,  +            "required": true,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 16,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 3,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 17,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 4,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 18,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 5,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 19,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 6,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 20,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 7,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 21,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 8,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 22,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 9,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 23,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 12,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 24,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 13,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 25,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 16,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.importtarget",           "fields": { @@ -188,6 +397,195 @@          }      },       { +        "pk": 9,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 9,  +            "formater_type": 1,  +            "target": "operation__operation_code",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 10,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 10,  +            "formater_type": 7,  +            "target": "section",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 11,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 10,  +            "formater_type": 8,  +            "target": "parcel_number",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 12,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 11,  +            "formater_type": 9,  +            "target": "year",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 13,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 12,  +            "formater_type": 8,  +            "target": "town__numero_insee",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 14,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 13,  +            "formater_type": 10,  +            "target": "address",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 15,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 14,  +            "formater_type": 1,  +            "target": "operation__operation_code",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 16,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 15,  +            "formater_type": 11,  +            "target": "external_id",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 17,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 16,  +            "formater_type": 12,  +            "target": "source_type",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 18,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 17,  +            "formater_type": 13,  +            "target": "support_type",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 19,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 18,  +            "formater_type": 1,  +            "target": "item_number",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 20,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 19,  +            "formater_type": 4,  +            "target": "authors__person__raw_name",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 21,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 20,  +            "formater_type": 14,  +            "target": "creation_date",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 22,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 21,  +            "formater_type": 15,  +            "target": "format_type",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 23,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 22,  +            "formater_type": 16,  +            "target": "description",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 24,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 23,  +            "formater_type": 16,  +            "target": "comment",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 25,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 24,  +            "formater_type": 17,  +            "target": "scale",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 26,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 25,  +            "formater_type": 16,  +            "target": "additional_information",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 5,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "DateFormater",  +            "many_split": "",  +            "options": "%Y/%m/%d" +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.formatertype",           "fields": { @@ -206,6 +604,60 @@          }      },       { +        "pk": 6,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "TypeFormater",  +            "many_split": "&",  +            "options": "archaeological_operations.models.Period" +        } +    },  +    { +        "pk": 15,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "TypeFormater",  +            "many_split": "",  +            "options": "Format" +        } +    },  +    { +        "pk": 12,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "TypeFormater",  +            "many_split": "",  +            "options": "SourceType" +        } +    },  +    { +        "pk": 13,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "TypeFormater",  +            "many_split": "",  +            "options": "SupportType" +        } +    },  +    { +        "pk": 16,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "1000" +        } +    },  +    { +        "pk": 11,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "12" +        } +    },  +    {          "pk": 3,           "model": "ishtar_common.formatertype",           "fields": { @@ -215,6 +667,15 @@          }      },       { +        "pk": 17,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "30" +        } +    },  +    {          "pk": 4,           "model": "ishtar_common.formatertype",           "fields": { @@ -224,21 +685,48 @@          }      },       { -        "pk": 5,  +        "pk": 7,           "model": "ishtar_common.formatertype",           "fields": { -            "formater_type": "DateFormater",  +            "formater_type": "UnicodeFormater",               "many_split": "",  -            "options": "%Y/%m/%d" +            "options": "4"          }      },       { -        "pk": 6,  +        "pk": 10,           "model": "ishtar_common.formatertype",           "fields": { -            "formater_type": "TypeFormater",  -            "many_split": "&",  -            "options": "archaeological_operations.models.Period" +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "500" +        } +    },  +    { +        "pk": 8,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "6" +        } +    },  +    { +        "pk": 9,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "YearFormater",  +            "many_split": "",  +            "options": "" +        } +    },  +    { +        "pk": 14,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "YearFormater",  +            "many_split": "",  +            "options": "%Y"          }      }  ]
\ No newline at end of file | 
