diff options
| 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 |
| commit | 175fadb6eab2abdbbf2d233173111de19efb7745 (patch) | |
| tree | 3e2a865cf0347226612cf10cd8d16c05c8f8f4d9 | |
| parent | e2e493bb66e8ffa88a5b5cce27020c74e4ec23c0 (diff) | |
| download | Ishtar-175fadb6eab2abdbbf2d233173111de19efb7745.tar.bz2 Ishtar-175fadb6eab2abdbbf2d233173111de19efb7745.zip | |
✨ admin: iconographic pattern types, listed building protection - add default data
4 files changed, 80 insertions, 6 deletions
diff --git a/archaeological_finds/admin.py b/archaeological_finds/admin.py index ff01cb106..c764cf66d 100644 --- a/archaeological_finds/admin.py +++ b/archaeological_finds/admin.py @@ -275,12 +275,12 @@ class RecommendedTreatmentTypeAdmin(GeneralTypeAdmin): general_models = [ models.AlterationCauseType, models.AlterationType, models.BatchType, - models.CollectionEntryModeType, models.IntegrityType, models.InventoryConformity, - models.InventoryMarkingPresence, models.MarkingType, models.MaterialTypeQualityType, - models.MuseumCollection, models.ObjectTypeQualityType, models.OriginalReproduction, - models.RemarkabilityType, models.TreatmentEmergencyType, models.DiscoveryMethod, - models.ExhibitionType, models.OwnershipStatus, models.FollowUpActionType, - models.StatementConditionType + models.CollectionEntryModeType, models.IconographicPatternType, models.IntegrityType, + models.InventoryConformity, models.InventoryMarkingPresence, models.ListedBuildingProtectionNature, + models.MarkingType, models.MaterialTypeQualityType, models.MuseumCollection, + models.ObjectTypeQualityType, models.OriginalReproduction, models.RemarkabilityType, + models.TreatmentEmergencyType, models.DiscoveryMethod, models.ExhibitionType, + models.OwnershipStatus, models.FollowUpActionType, models.StatementConditionType ] for model in general_models: 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) + ] diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 2527a4c83..3b02d751e 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -19,9 +19,11 @@ from archaeological_finds.models_finds import ( FindTreatment, FirstBaseFindView, FunctionalArea, + IconographicPatternType, IntegrityType, InventoryConformity, InventoryMarkingPresence, + ListedBuildingProtectionNature, MarkingType, MaterialType, MaterialTypeQualityType, @@ -87,9 +89,11 @@ __all__ = [ "FindUpstreamTreatments", "FollowUpActionType", "FunctionalArea", + "IconographicPatternType", "IntegrityType", "InventoryConformity", "InventoryMarkingPresence", + "ListedBuildingProtectionNature", "MarkingType", "MaterialType", "MaterialTypeQualityType", |
