diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-04-03 16:41:35 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-04-03 16:41:35 +0200 |
| commit | a53939a008c472ecbd254bfd6f7b6cae4ac80f9b (patch) | |
| tree | 8c784f3583b8c985dd27326e5bd7ece9957d8a2f | |
| parent | 17c5e580002c3b3e887d6f63c5c09a20a3f66dc4 (diff) | |
| download | Ishtar-a53939a008c472ecbd254bfd6f7b6cae4ac80f9b.tar.bz2 Ishtar-a53939a008c472ecbd254bfd6f7b6cae4ac80f9b.zip | |
🗃️ default values for heritage interest type, heritage and environmental protection, site relation types
4 files changed, 205 insertions, 0 deletions
diff --git a/archaeological_operations/migrations/0129_data_migration.json b/archaeological_operations/migrations/0129_data_migration.json new file mode 100644 index 000000000..e60f33f27 --- /dev/null +++ b/archaeological_operations/migrations/0129_data_migration.json @@ -0,0 +1,131 @@ +[ +{ + "model": "archaeological_operations.heritageandenvironmentalprotectiontype", + "fields": { + "label": "Site classé", + "txt_idx": "site-classe", + "comment": "", + "available": true, + "parent": [ + "protection-patrimoniale" + ], + "order": 10 + } +}, +{ + "model": "archaeological_operations.heritageandenvironmentalprotectiontype", + "fields": { + "label": "Site inscrit", + "txt_idx": "site-inscrit", + "comment": "", + "available": true, + "parent": [ + "protection-patrimoniale" + ], + "order": 10 + } +}, +{ + "model": "archaeological_operations.heritageandenvironmentalprotectiontype", + "fields": { + "label": "Natura 2000", + "txt_idx": "natura-2000", + "comment": "", + "available": true, + "parent": [ + "protection-environnementale" + ], + "order": 10 + } +}, +{ + "model": "archaeological_operations.heritageandenvironmentalprotectiontype", + "fields": { + "label": "Protection patrimoniale", + "txt_idx": "protection-patrimoniale", + "comment": "", + "available": true, + "parent": null, + "order": 10 + } +}, +{ + "model": "archaeological_operations.heritageandenvironmentalprotectiontype", + "fields": { + "label": "Protection environnementale", + "txt_idx": "protection-environnementale", + "comment": "", + "available": true, + "parent": null, + "order": 10 + } +}, +{ + "model": "archaeological_operations.heritageinteresttype", + "fields": { + "label": "Intérêt patrimonial 1", + "txt_idx": "interet-patrimonial-1", + "comment": "", + "available": true, + "parent": null, + "order": 10 + } +}, +{ + "model": "archaeological_operations.heritageinteresttype", + "fields": { + "label": "Intérêt patrimonial 2", + "txt_idx": "interet-patrimonial-2", + "comment": "", + "available": true, + "parent": null, + "order": 10 + } +}, +{ + "model": "archaeological_operations.siterelationtype", + "fields": { + "label": "Comprend", + "txt_idx": "comprend", + "comment": "", + "available": true, + "order": 1, + "symmetrical": false, + "tiny_label": null, + "inverse_relation": [ + "compris-dans" + ], + "logical_relation": null + } +}, +{ + "model": "archaeological_operations.siterelationtype", + "fields": { + "label": "Compris dans", + "txt_idx": "compris-dans", + "comment": "", + "available": true, + "order": 1, + "symmetrical": false, + "tiny_label": null, + "inverse_relation": [ + "comprend" + ], + "logical_relation": null + } +}, +{ + "model": "archaeological_operations.siterelationtype", + "fields": { + "label": "Lié à", + "txt_idx": "lie-a", + "comment": "", + "available": true, + "order": 1, + "symmetrical": true, + "tiny_label": null, + "inverse_relation": null, + "logical_relation": null + } +} +] diff --git a/archaeological_operations/migrations/0129_data_migration_heritageinterest_heritageenvprotection_relsite.py b/archaeological_operations/migrations/0129_data_migration_heritageinterest_heritageenvprotection_relsite.py new file mode 100644 index 000000000..59a884794 --- /dev/null +++ b/archaeological_operations/migrations/0129_data_migration_heritageinterest_heritageenvprotection_relsite.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, __): + QualifiedBiographicalNoteType = apps.get_model("archaeological_operations", "HeritageInterestType") + if not QualifiedBiographicalNoteType.objects.count(): + json_path = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-1] + ["0129_data_migration.json"]) + call_command("loaddata", json_path) + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_operations', '0128_add_editors'), + ] + + operations = [ + migrations.RunPython(load_data) + ] diff --git a/ishtar_common/migrations/0277_data_migration.json b/ishtar_common/migrations/0277_data_migration.json new file mode 100644 index 000000000..1bc40e4a6 --- /dev/null +++ b/ishtar_common/migrations/0277_data_migration.json @@ -0,0 +1,26 @@ +[ +{ + "model": "ishtar_common.qualifiedbiographicalnotetype", + "fields": { + "label": "Architecte", + "txt_idx": "architecte", + "comment": "", + "available": true, + "parent": null, + "order": 20, + "model": "S" + } +}, +{ + "model": "ishtar_common.qualifiedbiographicalnotetype", + "fields": { + "label": "Inventeur", + "txt_idx": "inventeur", + "comment": "", + "available": true, + "parent": null, + "order": 10, + "model": "S" + } +} +] diff --git a/ishtar_common/migrations/0277_data_migration_qualifiedbionotetype.py b/ishtar_common/migrations/0277_data_migration_qualifiedbionotetype.py new file mode 100644 index 000000000..b82306825 --- /dev/null +++ b/ishtar_common/migrations/0277_data_migration_qualifiedbionotetype.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, __): + QualifiedBiographicalNoteType = apps.get_model("ishtar_common", "QualifiedBiographicalNote") + if not QualifiedBiographicalNoteType.objects.count(): + json_path = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-1] + ["0277_data_migration.json"]) + call_command("loaddata", json_path) + + +class Migration(migrations.Migration): + + dependencies = [ + ('ishtar_common', '0276_add_editors'), + ] + + operations = [ + migrations.RunPython(load_data) + ] |
