diff options
Diffstat (limited to 'archaeological_context_records')
3 files changed, 61 insertions, 4 deletions
diff --git a/archaeological_context_records/migrations/0022_migrate_image.py b/archaeological_context_records/migrations/0022_migrate_image.py new file mode 100644 index 000000000..87ac0cc55 --- /dev/null +++ b/archaeological_context_records/migrations/0022_migrate_image.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.10 on 2018-05-11 12:03 +from __future__ import unicode_literals + +from django.db import migrations + +from ishtar_common.utils_migrations import migrate_simple_image_to_m2m + + +def migrate_image(apps, schema_editor): + ContextRecord = apps.get_model('archaeological_context_records', + 'ContextRecord') + IshtarImage = apps.get_model('ishtar_common', 'IshtarImage') + ContextRecordImage = apps.get_model('archaeological_context_records', + 'ContextRecordImage') + migrate_simple_image_to_m2m(ContextRecord, IshtarImage, ContextRecordImage) + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0021_auto_20180509_1736'), + ] + + operations = [ + migrations.RunPython(migrate_image), + ] diff --git a/archaeological_context_records/migrations/0023_auto_20180511_1232.py b/archaeological_context_records/migrations/0023_auto_20180511_1232.py new file mode 100644 index 000000000..e6d69127f --- /dev/null +++ b/archaeological_context_records/migrations/0023_auto_20180511_1232.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.10 on 2018-05-11 12:32 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_context_records', '0022_migrate_image'), + ] + + operations = [ + migrations.RemoveField( + model_name='contextrecord', + name='image', + ), + migrations.RemoveField( + model_name='contextrecord', + name='thumbnail', + ), + migrations.RemoveField( + model_name='historicalcontextrecord', + name='image', + ), + migrations.RemoveField( + model_name='historicalcontextrecord', + name='thumbnail', + ), + ] diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 396b91f67..1ae661524 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -33,8 +33,8 @@ from ishtar_common.utils import cached_label_changed from ishtar_common.models import GeneralType, BaseHistorizedItem, \ HistoricalRecords, OwnPerms, ShortMenuItem, Source, GeneralRelationType,\ GeneralRecordRelations, post_delete_record_relation, get_image_path, \ - ImageModel, post_save_cache, ValueGetter, BulkUpdatedItem, IshtarImage, \ - RelationItem, ThroughImage + post_save_cache, ValueGetter, BulkUpdatedItem, IshtarImage, RelationItem, \ + ThroughImage from archaeological_operations.models import Operation, Period, Parcel, \ ArchaeologicalSite @@ -206,8 +206,7 @@ class CRBulkView(object): class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, - ImageModel, OwnPerms, ValueGetter, ShortMenuItem, - RelationItem): + OwnPerms, ValueGetter, ShortMenuItem, RelationItem): SHOW_URL = 'show-contextrecord' SLUG = 'contextrecord' EXTERNAL_ID_KEY = 'context_record_external_id' |