summaryrefslogtreecommitdiff
path: root/archaeological_finds/migrations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2026-04-06 20:46:23 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2026-04-07 19:25:04 +0200
commit24086b977c19258ed7491c0dbc37ff8d3659d9eb (patch)
tree5043813254d15a3f97063b5159265d086bf18a92 /archaeological_finds/migrations
parent8f7bbc610d667353f9e8cb8e4ce1ed5de4f77449 (diff)
downloadIshtar-24086b977c19258ed7491c0dbc37ff8d3659d9eb.tar.bz2
Ishtar-24086b977c19258ed7491c0dbc37ff8d3659d9eb.zip
✨ sites - relations between finds: models, migrations, admin
Diffstat (limited to 'archaeological_finds/migrations')
-rw-r--r--archaeological_finds/migrations/0150_findrelationtype_findrecordrelations.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/archaeological_finds/migrations/0150_findrelationtype_findrecordrelations.py b/archaeological_finds/migrations/0150_findrelationtype_findrecordrelations.py
new file mode 100644
index 000000000..a7be6cc8b
--- /dev/null
+++ b/archaeological_finds/migrations/0150_findrelationtype_findrecordrelations.py
@@ -0,0 +1,58 @@
+# Generated by Django 4.2.21 on 2026-04-06 18:14
+
+import django.core.validators
+from django.db import migrations, models
+import django.db.models.deletion
+import ishtar_common.models_common
+import re
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0277_data_migration_qualifiedbionotetype'),
+ ('archaeological_finds', '0149_add_editors'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='FindRelationType',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('label', models.TextField(verbose_name='Label')),
+ ('txt_idx', models.TextField(help_text='The slug is the standardized version of the name. It contains only lowercase letters, numbers and hyphens. Each slug must be unique.', unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), 'Enter a valid “slug” consisting of letters, numbers, underscores or hyphens.', 'invalid')], verbose_name='Textual ID')),
+ ('comment', models.TextField(blank=True, default='', verbose_name='Comment')),
+ ('available', models.BooleanField(default=True, verbose_name='Available')),
+ ('order', models.IntegerField(default=1, verbose_name='Order')),
+ ('symmetrical', models.BooleanField(verbose_name='Symmetrical')),
+ ('tiny_label', models.CharField(blank=True, max_length=50, null=True, verbose_name='Tiny label')),
+ ('logical_relation', models.CharField(blank=True, choices=[('above', 'Above'), ('below', 'Below'), ('equal', 'Equal'), ('include', 'Include'), ('included', 'Is included')], max_length=10, null=True, verbose_name='Logical relation')),
+ ('inverse_relation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_finds.findrelationtype', verbose_name='Inverse relation')),
+ ],
+ options={
+ 'verbose_name': 'Find relation type',
+ 'verbose_name_plural': 'Find relation types',
+ 'ordering': ('order', 'label'),
+ },
+ bases=(ishtar_common.models_common.Cached, models.Model),
+ ),
+ migrations.CreateModel(
+ name='FindRecordRelations',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('timestamp_geo', models.IntegerField(blank=True, null=True, verbose_name='Timestamp geo')),
+ ('timestamp_label', models.IntegerField(blank=True, null=True, verbose_name='Timestamp label')),
+ ('imports', models.ManyToManyField(blank=True, related_name='imported_%(app_label)s_%(class)s', to='ishtar_common.import', verbose_name='Created by imports')),
+ ('imports_updated', models.ManyToManyField(blank=True, related_name='import_updated_%(app_label)s_%(class)s', to='ishtar_common.import', verbose_name='Updated by imports')),
+ ('left_record', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='right_relations', to='archaeological_finds.find')),
+ ('relation_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='archaeological_finds.findrelationtype')),
+ ('right_record', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='left_relations', to='archaeological_finds.find')),
+ ],
+ options={
+ 'verbose_name': 'Find record relation',
+ 'verbose_name_plural': 'Find record relations',
+ 'ordering': ('left_record__cached_label', 'relation_type', 'right_record__cached_label'),
+ 'permissions': [('view_findrelation', 'Can view all Find relations')],
+ },
+ ),
+ ]