summaryrefslogtreecommitdiff
path: root/archaeological_finds/migrations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2026-04-16 15:05:10 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2026-04-16 17:36:29 +0200
commit175fadb6eab2abdbbf2d233173111de19efb7745 (patch)
tree3e2a865cf0347226612cf10cd8d16c05c8f8f4d9 /archaeological_finds/migrations
parente2e493bb66e8ffa88a5b5cce27020c74e4ec23c0 (diff)
downloadIshtar-175fadb6eab2abdbbf2d233173111de19efb7745.tar.bz2
Ishtar-175fadb6eab2abdbbf2d233173111de19efb7745.zip
✨ admin: iconographic pattern types, listed building protection - add default data
Diffstat (limited to 'archaeological_finds/migrations')
-rw-r--r--archaeological_finds/migrations/0153_data_migration.json46
-rw-r--r--archaeological_finds/migrations/0153_data_migration_find_listed_building_icono_patterns.py24
2 files changed, 70 insertions, 0 deletions
diff --git a/archaeological_finds/migrations/0153_data_migration.json b/archaeological_finds/migrations/0153_data_migration.json
new file mode 100644
index 000000000..2391c6097
--- /dev/null
+++ b/archaeological_finds/migrations/0153_data_migration.json
@@ -0,0 +1,46 @@
+[
+ {
+ "model": "archaeological_finds.listedbuildingprotectionnature",
+ "fields": {
+ "label": "Inscription au titre des monuments historiques",
+ "txt_idx": "inscription-au-titre-des-monuments-historiques",
+ "comment": "",
+ "available": true,
+ "order": 10,
+ "parent": null
+ }
+ },
+ {
+ "model": "archaeological_finds.listedbuildingprotectionnature",
+ "fields": {
+ "label": "Classement au titre des monuments historiques",
+ "txt_idx": "classement-au-titre-des-monuments-historiques",
+ "comment": "",
+ "available": true,
+ "order": 20,
+ "parent": null
+ }
+ },
+ {
+ "model": "archaeological_finds.iconographicpatterntype",
+ "fields": {
+ "label": "Motif iconographique 1",
+ "txt_idx": "motif-iconographique-1",
+ "comment": "",
+ "available": true,
+ "order": 10,
+ "parent": null
+ }
+ },
+ {
+ "model": "archaeological_finds.iconographicpatterntype",
+ "fields": {
+ "label": "Motif iconographique 2",
+ "txt_idx": "motif-iconographique-2",
+ "comment": "",
+ "available": true,
+ "order": 20,
+ "parent": null
+ }
+ }
+]
diff --git a/archaeological_finds/migrations/0153_data_migration_find_listed_building_icono_patterns.py b/archaeological_finds/migrations/0153_data_migration_find_listed_building_icono_patterns.py
new file mode 100644
index 000000000..571197971
--- /dev/null
+++ b/archaeological_finds/migrations/0153_data_migration_find_listed_building_icono_patterns.py
@@ -0,0 +1,24 @@
+# Generated by Django 2.2.24 on 2024-02-10 12:07
+
+import os
+
+from django.db import migrations
+from django.core.management import call_command
+
+
+def load_data(apps, __):
+ IconographicPatternType = apps.get_model("archaeological_finds", "iconographicpatterntype")
+ if not IconographicPatternType.objects.count():
+ json_path = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-1] + ["0153_data_migration.json"])
+ call_command("loaddata", json_path)
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archaeological_finds', '0152_find_actors_heritage_museum_fields'),
+ ]
+
+ operations = [
+ migrations.RunPython(load_data)
+ ]