diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-02-13 16:50:15 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-04-16 16:41:51 +0200 |
commit | a73a0bad9334fb5d65e4ffd1eb7d65a2f189abc6 (patch) | |
tree | ca267834833529052cb75041f6e20d07078c08d8 | |
parent | ecbe63a787ea391b0db03c6f4bc7e5b8f79195ae (diff) | |
download | Ishtar-a73a0bad9334fb5d65e4ffd1eb7d65a2f189abc6.tar.bz2 Ishtar-a73a0bad9334fb5d65e4ffd1eb7d65a2f189abc6.zip |
🗃️ Context record - identification type changes to hierarchical (refs #5739)
-rw-r--r-- | archaeological_context_records/migrations/0115_auto_20240213_1640.py | 24 | ||||
-rw-r--r-- | archaeological_context_records/models.py | 5 | ||||
-rw-r--r-- | changelog/en/changelog_2022-06-15.md | 3 | ||||
-rw-r--r-- | changelog/fr/changelog_2023-01-25.md | 1 | ||||
-rw-r--r-- | ishtar_common/views_item.py | 10 |
5 files changed, 34 insertions, 9 deletions
diff --git a/archaeological_context_records/migrations/0115_auto_20240213_1640.py b/archaeological_context_records/migrations/0115_auto_20240213_1640.py new file mode 100644 index 000000000..9780581cb --- /dev/null +++ b/archaeological_context_records/migrations/0115_auto_20240213_1640.py @@ -0,0 +1,24 @@ +# Generated by Django 2.2.24 on 2024-02-13 16:40 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0114_contextrecord_imports_updated'), + ] + + operations = [ + migrations.AddField( + model_name='identificationtype', + name='parent', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_context_records.IdentificationType', verbose_name='Parent'), + ), + migrations.AlterField( + model_name='identificationtype', + name='order', + field=models.IntegerField(default=10, verbose_name='Order'), + ), + ] diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 4940a2d4a..63f15eb86 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -48,6 +48,7 @@ from ishtar_common.models import ( Imported, GeneralRelationType, GeneralRecordRelations, + OrderedHierarchicalType, post_delete_record_relation, post_save_cache, ValueGetter, @@ -340,9 +341,7 @@ post_save.connect(post_save_cache, sender=ActivityType) post_delete.connect(post_save_cache, sender=ActivityType) -class IdentificationType(GeneralType): - order = models.IntegerField(_("Order")) - +class IdentificationType(OrderedHierarchicalType): class Meta: verbose_name = _("Identification Type") verbose_name_plural = _("Identification Types") diff --git a/changelog/en/changelog_2022-06-15.md b/changelog/en/changelog_2022-06-15.md index eca75c52f..0ec21b3f5 100644 --- a/changelog/en/changelog_2022-06-15.md +++ b/changelog/en/changelog_2022-06-15.md @@ -9,7 +9,8 @@ v4.0.XX - 2099-12-31 - add coordinates display - get coordinates from geolocalisation - geo sheet: display point buffer -- Container: new field Code (forms, sheet, search index and autocomplete) (#5704)' +- Container: new field Code (forms, sheet, search index and autocomplete) (#5704) +- Context record - identification type changes to hierarchical (#5739) #### Imports ##### - pre-import forms diff --git a/changelog/fr/changelog_2023-01-25.md b/changelog/fr/changelog_2023-01-25.md index 15c600ca9..6889919d8 100644 --- a/changelog/fr/changelog_2023-01-25.md +++ b/changelog/fr/changelog_2023-01-25.md @@ -9,6 +9,7 @@ v4.0.XX - 2099-12-31 - obtention des coordonnées depuis la géolocalisation - fiche géographique: affichage du tampon du point - Contenant : nouveau champ Code (formulaires, fiche, index de recherche et autocomplétion) (#5704) +- Unité d'enregistrement - type d'identification passe en hiérarchique (#5739) #### Imports ##### diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 8c1c0b734..735ccf2e1 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -553,14 +553,15 @@ def revert_item(model): HIERARCHIC_LEVELS = 5 LIST_FIELDS = { # key: hierarchic depth - "periods": HIERARCHIC_LEVELS, - "period": HIERARCHIC_LEVELS, - "unit": HIERARCHIC_LEVELS, + "conservatory_state": HIERARCHIC_LEVELS, + "identification": HIERARCHIC_LEVELS, "material_types": HIERARCHIC_LEVELS, "material_type": HIERARCHIC_LEVELS, - "conservatory_state": HIERARCHIC_LEVELS, "object_types": HIERARCHIC_LEVELS, + "period": HIERARCHIC_LEVELS, + "periods": HIERARCHIC_LEVELS, "source_type": HIERARCHIC_LEVELS, + "unit": HIERARCHIC_LEVELS, "batch": 0, "preservation_to_considers": 0, "integrities": 0, @@ -584,7 +585,6 @@ LIST_FIELDS = { # key: hierarchic depth "provider": 0, "excavation_technics": 0, "activity": 0, - "identification": 0, } HIERARCHIC_FIELDS = list(LIST_FIELDS.keys()) |