summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/fixtures/initial_importtypes-qfield.json483
-rw-r--r--ishtar_common/tests.py2
2 files changed, 484 insertions, 1 deletions
diff --git a/ishtar_common/fixtures/initial_importtypes-qfield.json b/ishtar_common/fixtures/initial_importtypes-qfield.json
new file mode 100644
index 000000000..0461f4b63
--- /dev/null
+++ b/ishtar_common/fixtures/initial_importtypes-qfield.json
@@ -0,0 +1,483 @@
+[
+ {
+ "model": "ishtar_common.importertype",
+ "fields": {
+ "name": "QField - Export - Mobilier",
+ "slug": "qfield-export-mobilier",
+ "description": "test",
+ "associated_models": [
+ "archaeological_finds.models_finds.Find"
+ ],
+ "is_template": true,
+ "unicity_keys": "label",
+ "available": true,
+ "users": [],
+ "created_models": [
+ [
+ "archaeological_finds.models_finds.Find"
+ ],
+ [
+ "archaeological_finds.models.BaseFind"
+ ],
+ [
+ "archaeological_operations.models.Parcel"
+ ],
+ [
+ "archaeological_context_records.models.ContextRecord"
+ ]
+ ]
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "id",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 1,
+ "description": "",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": false,
+ "export_field_name": null
+ }
+ },
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "id_unique",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 2,
+ "description": "Identifiant de l'entit\u00e9 cr\u00e9\u00e9e",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": true,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "ue",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 3,
+ "description": "",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": true,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "date",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 4,
+ "description": "Moment d'enregistrement de l'entit\u00e9",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": false,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "x",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 5,
+ "description": "Coordonn\u00e9e X de l'entit\u00e9",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": false,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "y",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 6,
+ "description": "Coordonn\u00e9e Y de l'entit\u00e9",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": false,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "z",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 7,
+ "description": "Coordonn\u00e9e Z de l'entit\u00e9",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": false,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "materiau(x)",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 8,
+ "description": "Mat\u00e9riau(x) de l'entit\u00e9 cr\u00e9\u00e9e",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": false,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "descr",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 9,
+ "description": "Description et commentaires sur l'entit\u00e9 cr\u00e9\u00e9e",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": false,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "media",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 10,
+ "description": "",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": false,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importercolumn",
+ "fields": {
+ "label": "wkt",
+ "importer_type": [
+ "qfield-export-mobilier"
+ ],
+ "col_number": 11,
+ "description": "G\u00e9om\u00e9trie au format WKT de l'entit\u00e9 cr\u00e9\u00e9e",
+ "regexp_pre_filter": null,
+ "value_format": null,
+ "required": true,
+ "export_field_name": null
+ }
+},
+{
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 2
+ ],
+ "field_name": "base_finds__label",
+ "force_new": false,
+ "concat": false,
+ "concat_str": null
+ }
+},
+{
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 2
+ ],
+ "field_name": "documents__title",
+ "force_new": false,
+ "concat": false,
+ "concat_str": null
+ }
+},
+{
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 5
+ ],
+ "field_name": "base_finds__geodata__x",
+ "force_new": false,
+ "concat": false,
+ "concat_str": null
+ }
+},
+{
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 6
+ ],
+ "field_name": "base_finds__geodata__y",
+ "force_new": false,
+ "concat": false,
+ "concat_str": null
+ }
+},
+{
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 7
+ ],
+ "field_name": "base_finds__geodata__z",
+ "force_new": false,
+ "concat": false,
+ "concat_str": null
+ }
+},
+{
+ "model": "ishtar_common.importerduplicatefield",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 11
+ ],
+ "field_name": "base_finds__geodata__point_2d",
+ "force_new": false,
+ "concat": false,
+ "concat_str": null
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 1
+ ],
+ "target": "index",
+ "formater_type": [
+ "IntegerFormater",
+ "",
+ ""
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 2
+ ],
+ "target": "label",
+ "formater_type": [
+ "UnicodeFormater",
+ "200",
+ ""
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 3
+ ],
+ "target": "base_finds__context_record__label",
+ "formater_type": [
+ "UnicodeFormater",
+ "200",
+ ""
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 4
+ ],
+ "target": "base_finds__discovery_date",
+ "formater_type": [
+ "DateFormater",
+ "%d/%m/%Y | %Y-%m-%d",
+ " | "
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 5
+ ],
+ "target": "base_finds__x",
+ "formater_type": [
+ "FloatFormater",
+ "",
+ ""
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 6
+ ],
+ "target": "base_finds__y",
+ "formater_type": [
+ "FloatFormater",
+ "",
+ ""
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 7
+ ],
+ "target": "base_finds__z",
+ "formater_type": [
+ "FloatFormater",
+ "",
+ ""
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 8
+ ],
+ "target": "material_types",
+ "formater_type": [
+ "TypeFormater",
+ "archaeological_finds.models.MaterialType",
+ "&"
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 9
+ ],
+ "target": "description",
+ "formater_type": [
+ "UnicodeFormater",
+ "",
+ ""
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 10
+ ],
+ "target": "documents_image",
+ "formater_type": [
+ "FileFormater",
+ "",
+ ""
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+},
+{
+ "model": "ishtar_common.importtarget",
+ "fields": {
+ "column": [
+ "qfield-export-mobilier",
+ 11
+ ],
+ "target": "base_finds__point_2d",
+ "formater_type": [
+ "UnicodeFormater",
+ "",
+ ""
+ ],
+ "force_new": false,
+ "concat": false,
+ "concat_str": null,
+ "comment": ""
+ }
+ }
+] \ No newline at end of file
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 8d3fd837a..d14c861bd 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -2736,7 +2736,7 @@ class BaseImportTest(TestCase):
root = os.path.join(settings.LIB_BASE_PATH, "archaeological_finds", "tests")
self.root = root
# Path to zip
- importer_filename = os.path.join(root, "qfield-importeur-test.zip")
+ importer_filename = os.path.join(root, "qfield-csv-test.zip")
restore_serialized(importer_filename)
imp_group = models.ImporterGroup.objects.get(slug="qfield-csv-test") # Must change the name !!!
# Opening of the csv