summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_finds/tests/import_loca_test.json16
-rw-r--r--ishtar_common/fixtures/initial_importtypes-fr.json40
-rw-r--r--ishtar_common/fixtures/initial_importtypes-tests-fr.json72
-rw-r--r--ishtar_common/migrations/0275_importerduplicatefield_concat_str.py23
-rw-r--r--ishtar_common/models_imports.py8
5 files changed, 91 insertions, 68 deletions
diff --git a/archaeological_finds/tests/import_loca_test.json b/archaeological_finds/tests/import_loca_test.json
index 1f0a9054a..819113306 100644
--- a/archaeological_finds/tests/import_loca_test.json
+++ b/archaeological_finds/tests/import_loca_test.json
@@ -145,7 +145,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -164,7 +164,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -183,7 +183,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -202,7 +202,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -221,7 +221,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -240,7 +240,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -259,7 +259,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -273,7 +273,7 @@
"field_name": "container__responsible__external_id",
"force_new": false,
"concat": false,
- "concat_str": null
+ "concat_str": ""
}
},
{
diff --git a/ishtar_common/fixtures/initial_importtypes-fr.json b/ishtar_common/fixtures/initial_importtypes-fr.json
index 5f88400b0..c18e71284 100644
--- a/ishtar_common/fixtures/initial_importtypes-fr.json
+++ b/ishtar_common/fixtures/initial_importtypes-fr.json
@@ -3938,7 +3938,7 @@
"field_name": "base_finds__context_record__external_id",
"force_new": false,
"concat": true,
- "concat_str": null
+ "concat_str": ""
}
},
{
@@ -3951,7 +3951,7 @@
"field_name": "base_finds__external_id",
"force_new": false,
"concat": true,
- "concat_str": null
+ "concat_str": ""
}
},
{
@@ -3964,7 +3964,7 @@
"field_name": "external_id",
"force_new": false,
"concat": true,
- "concat_str": null
+ "concat_str": ""
}
},
{
@@ -4232,7 +4232,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -5524,7 +5524,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -6341,7 +6341,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -6550,7 +6550,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -6569,7 +6569,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -6588,7 +6588,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -6626,7 +6626,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7196,7 +7196,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7215,7 +7215,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7234,7 +7234,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7253,7 +7253,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7272,7 +7272,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7291,7 +7291,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7310,7 +7310,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7329,7 +7329,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7348,7 +7348,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -7367,7 +7367,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
}
diff --git a/ishtar_common/fixtures/initial_importtypes-tests-fr.json b/ishtar_common/fixtures/initial_importtypes-tests-fr.json
index 0123f7223..cdaa5255b 100644
--- a/ishtar_common/fixtures/initial_importtypes-tests-fr.json
+++ b/ishtar_common/fixtures/initial_importtypes-tests-fr.json
@@ -725,7 +725,7 @@
"field_name": "label",
"force_new": false,
"concat": false,
- "concat_str": null
+ "concat_str": ""
}
},
{
@@ -751,7 +751,7 @@
"field_name": "scientist__name",
"force_new": false,
"concat": false,
- "concat_str": null
+ "concat_str": ""
}
},
{
@@ -977,7 +977,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -996,7 +996,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1015,7 +1015,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1034,7 +1034,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1053,7 +1053,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1072,7 +1072,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1091,7 +1091,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1110,7 +1110,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1148,7 +1148,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1167,7 +1167,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1205,7 +1205,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1224,7 +1224,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1243,7 +1243,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1262,7 +1262,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1281,7 +1281,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1300,7 +1300,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1338,7 +1338,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1357,7 +1357,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1395,7 +1395,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1414,7 +1414,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1433,7 +1433,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1452,7 +1452,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1471,7 +1471,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1509,7 +1509,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1528,7 +1528,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1566,7 +1566,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1585,7 +1585,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1604,7 +1604,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1623,7 +1623,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1642,7 +1642,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1661,7 +1661,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1699,7 +1699,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1718,7 +1718,7 @@
],
"force_new": false,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
@@ -1794,7 +1794,7 @@
],
"force_new": true,
"concat": false,
- "concat_str": null,
+ "concat_str": "",
"comment": ""
}
},
diff --git a/ishtar_common/migrations/0275_importerduplicatefield_concat_str.py b/ishtar_common/migrations/0275_importerduplicatefield_concat_str.py
new file mode 100644
index 000000000..be535d629
--- /dev/null
+++ b/ishtar_common/migrations/0275_importerduplicatefield_concat_str.py
@@ -0,0 +1,23 @@
+# Generated by Django 4.2.19 on 2026-02-09 15:17
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0274_import_gis_options'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='importerduplicatefield',
+ name='concat_str',
+ field=models.CharField(blank=True, default='', max_length=50, verbose_name='Concatenate character'),
+ ),
+ migrations.AlterField(
+ model_name='importtarget',
+ name='concat_str',
+ field=models.CharField(blank=True, default='', max_length=50, verbose_name='Concatenate character'),
+ ),
+ ]
diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py
index b13267937..6db0e1d1d 100644
--- a/ishtar_common/models_imports.py
+++ b/ishtar_common/models_imports.py
@@ -932,11 +932,11 @@ class ImporterDuplicateField(models.Model):
field_name = models.CharField(
_("Field name"), blank=True, null=True, max_length=200
)
- force_new = models.BooleanField(_("Force creation of new items"), default=False)
concat = models.BooleanField(_("Concatenate with existing"), default=False)
concat_str = models.CharField(
- _("Concatenate character"), max_length=5, blank=True, null=True
+ _("Concatenate character"), max_length=50, blank=True, default=""
)
+ force_new = models.BooleanField(_("Force creation of new items"), default=False)
objects = ImporterDuplicateFieldManager()
class Meta:
@@ -1039,11 +1039,11 @@ class ImportTarget(models.Model):
formater_type = models.ForeignKey(
"FormaterType", related_name="targets", on_delete=models.CASCADE
)
- force_new = models.BooleanField(_("Force creation of new items"), default=False)
concat = models.BooleanField(_("Concatenate with existing"), default=False)
concat_str = models.CharField(
- _("Concatenate character"), max_length=5, blank=True, null=True
+ _("Concatenate character"), max_length=50, blank=True, default=""
)
+ force_new = models.BooleanField(_("Force creation of new items"), default=False)
comment = models.TextField(_("Comment"), blank=True, null=True)
objects = ImportTargetManager()