summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_context_records/migrations/0115_auto_20240213_1640.py24
-rw-r--r--archaeological_context_records/models.py5
-rw-r--r--changelog/en/changelog_2022-06-15.md3
-rw-r--r--changelog/fr/changelog_2023-01-25.md1
-rw-r--r--ishtar_common/views_item.py10
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 0d2014996..71a13ed10 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 d7a47a625..282a2a23b 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 5d29a9850..88f746b4e 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())