summaryrefslogtreecommitdiff
path: root/archaeological_finds/migrations/0133_exhibition.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/migrations/0133_exhibition.py')
-rw-r--r--archaeological_finds/migrations/0133_exhibition.py32
1 files changed, 31 insertions, 1 deletions
diff --git a/archaeological_finds/migrations/0133_exhibition.py b/archaeological_finds/migrations/0133_exhibition.py
index a4a29168e..9ef1aa7e8 100644
--- a/archaeological_finds/migrations/0133_exhibition.py
+++ b/archaeological_finds/migrations/0133_exhibition.py
@@ -17,9 +17,18 @@ import simple_history.models
def create_default(apps, __):
+ TreatmentFileType = apps.get_model(
+ "archaeological_finds", "TreatmentFileType")
+ loan, __ = TreatmentFileType.objects.get_or_create(
+ txt_idx="loan-for-exhibition",
+ defaults={"label": "Exposition"}
+ )
+ loan.is_exhibition = True
+ loan.save()
ExhibitionType = apps.get_model("archaeological_finds", "ExhibitionType")
ExhibitionType.objects.get_or_create(
- txt_idx="exhibition", defaults={"label": "Exposition"}
+ txt_idx="exhibition",
+ defaults={"label": "Exposition", "treatment_file_type_id": loan.id}
)
@@ -40,6 +49,7 @@ class Migration(migrations.Migration):
('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')),
+ ('treatment_file_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='archaeological_finds.TreatmentFileType', verbose_name='Treatment request type')),
],
options={
'verbose_name': 'Exhibition type',
@@ -128,4 +138,24 @@ class Migration(migrations.Migration):
unique_together={('year', 'name')},
),
migrations.RunPython(create_default),
+ migrations.AddField(
+ model_name='historicaltreatmentfile',
+ name='exhibition_location',
+ field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='archaeological_warehouse.Warehouse', verbose_name='Exhibition location'),
+ ),
+ migrations.AddField(
+ model_name='treatmentfile',
+ name='exhibition_location',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='archaeological_warehouse.Warehouse', verbose_name='Exhibition location'),
+ ),
+ migrations.AddField(
+ model_name='historicaltreatmentfile',
+ name='insurance_provider',
+ field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='ishtar_common.Organization', verbose_name='Insurance provider'),
+ ),
+ migrations.AddField(
+ model_name='treatmentfile',
+ name='insurance_provider',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='insurance_provider_of', to='ishtar_common.Organization', verbose_name='Insurance provider'),
+ ),
]