# Generated by Django 4.2.21 on 2026-03-04 14:04 from django.conf import settings import django.contrib.postgres.indexes import django.contrib.postgres.search import django.core.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import ishtar_common.models import ishtar_common.models_common import re class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('ishtar_common', '0272_ishtarsiteprofile_statementcondition'), ('archaeological_finds', '0145_migrate_periods_and_datings'), ] operations = [ migrations.CreateModel( name='FollowUpActionType', 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.followupactiontype', verbose_name='Parent')), ], options={ 'verbose_name': 'Follow-up action type', 'verbose_name_plural': 'Follow-up action types', 'ordering': ('order', 'parent__label', 'label'), }, bases=(ishtar_common.models_common.Cached, models.Model), ), migrations.AlterModelOptions( name='ownertype', options={'ordering': ('parent__order', 'parent__label', 'order', 'label'), 'verbose_name': 'Owner type', 'verbose_name_plural': 'Owner types'}, ), migrations.AddField( model_name='treatmenttype', name='is_statement_condition', field=models.BooleanField(default=False, help_text='Available as a treatment for statement condition.', verbose_name='Related to statement condition'), ), migrations.AlterField( model_name='find', name='preservation_to_considers', field=models.ManyToManyField(blank=True, help_text='Deprecated', related_name='old_finds_recommended', to='archaeological_finds.treatmenttype', verbose_name='Recommended treatments'), ), migrations.AlterField( model_name='ownershipstatus', name='txt_idx', field=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'), ), migrations.AlterField( model_name='ownertype', name='txt_idx', field=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'), ), migrations.AlterField( model_name='recommendedtreatmenttype', name='txt_idx', field=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'), ), migrations.CreateModel( name='StatementConditionType', 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.statementconditiontype', verbose_name='Parent')), ], options={ 'verbose_name': 'Statement condition type', 'verbose_name_plural': 'Statement condition types', 'ordering': ('order', 'parent__label', 'label'), }, bases=(ishtar_common.models_common.Cached, models.Model), ), migrations.CreateModel( name='StatementCondition', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('search_vector', django.contrib.postgres.search.SearchVectorField(blank=True, help_text='Auto filled at save', null=True, verbose_name='Search vector')), ('timestamp_geo', models.IntegerField(blank=True, null=True, verbose_name='Timestamp geo')), ('timestamp_label', models.IntegerField(blank=True, null=True, verbose_name='Timestamp label')), ('data', models.JSONField(blank=True, default=dict)), ('last_modified', models.DateTimeField(blank=True, default=django.utils.timezone.now)), ('created', models.DateTimeField(blank=True, default=django.utils.timezone.now)), ('history_m2m', models.JSONField(blank=True, default=dict)), ('need_update', models.BooleanField(default=False, verbose_name='Need update')), ('locked', models.BooleanField(default=False, verbose_name='Item locked for edition')), ('cached_label', models.TextField(blank=True, db_index=True, default='', help_text='Generated automatically - do not edit', verbose_name='Cached name')), ('complete_identifier', models.TextField(blank=True, default='', verbose_name='Complete identifier')), ('custom_index', models.IntegerField(blank=True, null=True, verbose_name='Custom index')), ('date', models.DateField(verbose_name='Date')), ('applied', models.CharField(choices=[('D', 'Draft'), ('V', 'Validated'), ('T', 'Validated with treatment')], default='D', verbose_name='Input status')), ('initial', models.BooleanField(default=False, verbose_name='Initial')), ('last', models.BooleanField(default=True, verbose_name='Last')), ('campaign_number', models.TextField(blank=True, default='', verbose_name='Campaign/observation number')), ('report_number', models.TextField(blank=True, default='', verbose_name='Report number')), ('observations', models.TextField(blank=True, default='', verbose_name='Observations')), ('conservatory_comment', models.TextField(blank=True, default='', verbose_name='Conservatory comment')), ('description', models.TextField(blank=True, default='', verbose_name='Description')), ('find_number', models.IntegerField(blank=True, null=True, verbose_name='Number of remains')), ('museum_observed_quantity', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='Observed quantity')), ('length', models.FloatField(blank=True, null=True, verbose_name='Length (cm)')), ('width', models.FloatField(blank=True, null=True, verbose_name='Width (cm)')), ('height', models.FloatField(blank=True, null=True, verbose_name='Height (cm)')), ('volume', models.FloatField(blank=True, null=True, verbose_name='Volume (l)')), ('weight', models.FloatField(blank=True, null=True, verbose_name='Weight')), ('diameter', models.FloatField(blank=True, null=True, verbose_name='Diameter (cm)')), ('circumference', models.FloatField(blank=True, null=True, verbose_name='Circumference (cm)')), ('thickness', models.FloatField(blank=True, null=True, verbose_name='Thickness (cm)')), ('clutter_long_side', models.FloatField(blank=True, null=True, verbose_name='Clutter - long side (cm)')), ('clutter_short_side', models.FloatField(blank=True, null=True, verbose_name='Clutter - short side (cm)')), ('clutter_height', models.FloatField(blank=True, null=True, verbose_name='Clutter - height (cm)')), ('dimensions_comment', models.TextField(blank=True, default='', verbose_name='Dimensions comment')), ('alteration_causes', models.ManyToManyField(blank=True, to='archaeological_finds.alterationcausetype', verbose_name='Alteration cause')), ('alterations', models.ManyToManyField(blank=True, to='archaeological_finds.alterationtype', verbose_name='Alteration')), ('conservatory_states', models.ManyToManyField(blank=True, to='archaeological_finds.conservatorystate', verbose_name='Conservatory states')), ('find', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='statement_conditions', to='archaeological_finds.find', verbose_name='Find')), ('follow_up_actions', models.ManyToManyField(blank=True, to='archaeological_finds.followupactiontype', verbose_name='Follow-up actions')), ('history_creator', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Creator')), ('history_modifier', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Last editor')), ('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')), ('integrities', models.ManyToManyField(blank=True, to='archaeological_finds.integritytype', verbose_name='Integrity')), ('ishtar_users', models.ManyToManyField(blank=True, related_name='%(class)s_associated', to='ishtar_common.ishtaruser')), ('lock_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Locked by')), ('museum_inventory_marking_presence', models.ManyToManyField(blank=True, related_name='statement_conditions', to='archaeological_finds.inventorymarkingpresence', verbose_name='Presence of inventory marking')), ('museum_marking_type', models.ManyToManyField(blank=True, related_name='statement_conditions', to='archaeological_finds.markingtype', verbose_name='Type of marking')), ('recommended_treatments', models.ManyToManyField(blank=True, to='archaeological_finds.recommendedtreatmenttype', verbose_name='Recommended treatments')), ('statement_condition_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='archaeological_finds.statementconditiontype', verbose_name='Type')), ('treatment_emergency', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_finds.treatmentemergencytype', verbose_name='Treatment emergency')), ('verification_officer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ishtar_common.person', verbose_name='Verification officer')), ], options={ 'verbose_name': 'Statement of condition', 'verbose_name_plural': 'Statements of condition', 'ordering': ('find', '-date', 'cached_label'), }, bases=(ishtar_common.models_common.DocumentItem, ishtar_common.models_common.StatisticItem, ishtar_common.models_common.TemplateItem, models.Model, ishtar_common.models_common.CachedGen, ishtar_common.models_common.FixAssociated, ishtar_common.models.ValueGetter), ), migrations.AddField( model_name='historicaltreatment', name='statement_condition', field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='archaeological_finds.statementcondition', verbose_name='Statement condition'), ), migrations.AddField( model_name='treatment', name='statement_condition', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_finds.statementcondition', verbose_name='Statement condition'), ), migrations.AddIndex( model_name='statementcondition', index=django.contrib.postgres.indexes.GinIndex(fields=['data'], name='archaeologi_data_fdbd6f_gin'), ), ]