summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
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
commita73a0bad9334fb5d65e4ffd1eb7d65a2f189abc6 (patch)
treeca267834833529052cb75041f6e20d07078c08d8 /archaeological_context_records
parentecbe63a787ea391b0db03c6f4bc7e5b8f79195ae (diff)
downloadIshtar-a73a0bad9334fb5d65e4ffd1eb7d65a2f189abc6.tar.bz2
Ishtar-a73a0bad9334fb5d65e4ffd1eb7d65a2f189abc6.zip
🗃️ Context record - identification type changes to hierarchical (refs #5739)
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/migrations/0115_auto_20240213_1640.py24
-rw-r--r--archaeological_context_records/models.py5
2 files changed, 26 insertions, 3 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")