summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-01-09 15:20:00 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-02-05 10:56:44 +0100
commit21c1df6c555b275ea6fde1ba936baf18d419b237 (patch)
treed44ec2a3686a961f1728ad1e4e86db79dd71da6a
parent61e981d30af776e6a64394b56110063e86f0bab0 (diff)
downloadIshtar-21c1df6c555b275ea6fde1ba936baf18d419b237.tar.bz2
Ishtar-21c1df6c555b275ea6fde1ba936baf18d419b237.zip
🏷️ add default data types for geo origin and buffer
-rw-r--r--ishtar_common/fixtures/initial_geo-fr.json15
-rw-r--r--ishtar_common/migrations/0235_default_geo_types.py43
2 files changed, 56 insertions, 2 deletions
diff --git a/ishtar_common/fixtures/initial_geo-fr.json b/ishtar_common/fixtures/initial_geo-fr.json
index a7563cb85..e84d4fbdb 100644
--- a/ishtar_common/fixtures/initial_geo-fr.json
+++ b/ishtar_common/fixtures/initial_geo-fr.json
@@ -530,7 +530,18 @@
"comment": "",
"available": true,
"parent": null,
- "order": 10
+ "order": 40
+ }
+},
+{
+ "model": "ishtar_common.geoorigintype",
+ "fields": {
+ "label": "Vectorisation de photographies a\u00e9riennes",
+ "txt_idx": "vectorisation-de-photographie-aerienne",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 30
}
},
{
@@ -541,7 +552,7 @@
"comment": "",
"available": true,
"parent": null,
- "order": 10
+ "order": 20
}
},
{
diff --git a/ishtar_common/migrations/0235_default_geo_types.py b/ishtar_common/migrations/0235_default_geo_types.py
new file mode 100644
index 000000000..2177f351a
--- /dev/null
+++ b/ishtar_common/migrations/0235_default_geo_types.py
@@ -0,0 +1,43 @@
+# Generated by Django 2.2.24 on 2024-01-09 14:57
+
+from django.db import migrations
+
+
+def create_data(apps, __):
+ GeoOriginType = apps.get_model("ishtar_common", "GeoOriginType")
+ GeoOriginType.objects.get_or_create(
+ txt_idx="releve-topographique",
+ defaults={"label": "Relevé topographique", "available": True, "order": 10}
+ )
+ GeoOriginType.objects.get_or_create(
+ txt_idx="releve-gps",
+ defaults={"label": "Relevé GPS", "available": True, "order": 20}
+ )
+ GeoOriginType.objects.get_or_create(
+ txt_idx="vectorisation-de-photographie-aerienne",
+ defaults={"label": "Vectorisation de photographie aérienne", "available": True, "order": 30}
+ )
+ GeoOriginType.objects.get_or_create(
+ txt_idx="vectorisation-de-carte-ancienne",
+ defaults={"label": "Vectorisation de carte ancienne", "available": True, "order": 40}
+ )
+ GeoBufferType = apps.get_model("ishtar_common", "GeoBufferType")
+ GeoBufferType.objects.get_or_create(
+ txt_idx="incertitude",
+ defaults={"label": "Incertitude", "available": True, "order": 10}
+ )
+ GeoBufferType.objects.get_or_create(
+ txt_idx="rayon-de-collecte",
+ defaults={"label": "Rayon de collecte", "available": True, "order": 20}
+ )
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0234_gdprlog_gdprperson'),
+ ]
+
+ operations = [
+ migrations.RunPython(create_data)
+ ]