summaryrefslogtreecommitdiff
path: root/archaeological_finds/migrations/0129_discovery_method.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/migrations/0129_discovery_method.py')
-rw-r--r--archaeological_finds/migrations/0129_discovery_method.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/archaeological_finds/migrations/0129_discovery_method.py b/archaeological_finds/migrations/0129_discovery_method.py
new file mode 100644
index 000000000..94af962af
--- /dev/null
+++ b/archaeological_finds/migrations/0129_discovery_method.py
@@ -0,0 +1,50 @@
+# Generated by Django 2.2.24 on 2024-09-20 12:38
+
+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 = [
+ ('archaeological_finds', '0128_find_first_full_location'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='findtreatment',
+ name='location_type',
+ field=models.CharField(choices=[['C', 'Current'], ['R', 'Reference'], ['B', 'Reference/current']], default='C', max_length=1, verbose_name='Location type'),
+ ),
+ migrations.CreateModel(
+ name='DiscoveryMethod',
+ 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=10, verbose_name='Order')),
+ ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_finds.DiscoveryMethod', verbose_name='Parent')),
+ ],
+ options={
+ 'verbose_name': 'Discovery method type',
+ 'verbose_name_plural': 'Discovery method types',
+ 'ordering': ('order', 'label'),
+ },
+ bases=(ishtar_common.models_common.Cached, models.Model),
+ ),
+ migrations.AddField(
+ model_name='basefind',
+ name='discovery_method',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_finds.DiscoveryMethod', verbose_name='Discovery method'),
+ ),
+ migrations.AddField(
+ model_name='historicalbasefind',
+ name='discovery_method',
+ field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='archaeological_finds.DiscoveryMethod', verbose_name='Discovery method'),
+ ),
+ ]