diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-01 15:56:17 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-12 09:57:24 +0200 |
commit | 202fb132953d115c2b1983f5f50d2f4b62bb9d5d (patch) | |
tree | f6c76e265d0f7ee477d38c14010ba08901a313bc /ishtar_common | |
parent | 572b9047260322ed19cc9f674657b8be8d62c052 (diff) | |
download | Ishtar-202fb132953d115c2b1983f5f50d2f4b62bb9d5d.tar.bz2 Ishtar-202fb132953d115c2b1983f5f50d2f4b62bb9d5d.zip |
Migrations to clean older models for images and sources (refs #4107)
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/migrations/0056_auto_20180601_1555.py | 52 | ||||
-rw-r--r-- | ishtar_common/models.py | 4 |
2 files changed, 54 insertions, 2 deletions
diff --git a/ishtar_common/migrations/0056_auto_20180601_1555.py b/ishtar_common/migrations/0056_auto_20180601_1555.py new file mode 100644 index 000000000..fee995df9 --- /dev/null +++ b/ishtar_common/migrations/0056_auto_20180601_1555.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.10 on 2018-06-01 15:55 +from __future__ import unicode_literals + +from django.db import migrations, models +import ishtar_common.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_warehouse', '0021_auto_20180601_1555'), + ('archaeological_context_records', '0026_auto_20180601_1555'), + ('archaeological_finds', '0029_auto_20180601_1555'), + ('archaeological_operations', '0032_auto_20180601_1555'), + ('ishtar_common', '0055_auto_20180530_1900'), + ] + + operations = [ + migrations.RemoveField( + model_name='ishtarimage', + name='authors', + ), + migrations.RemoveField( + model_name='ishtarimage', + name='format_type', + ), + migrations.RemoveField( + model_name='ishtarimage', + name='licenses', + ), + migrations.RemoveField( + model_name='ishtarimage', + name='source_type', + ), + migrations.RemoveField( + model_name='ishtarimage', + name='support_type', + ), + migrations.AlterModelOptions( + name='document', + options={'ordering': ('title',), 'permissions': (('view_document', 'Can view all Documents'), ('view_own_document', 'Can view own Document'), ('add_own_document', 'Can add own Document'), ('change_own_document', 'Can change own Document'), ('delete_own_document', 'Can delete own Document')), 'verbose_name': 'Document', 'verbose_name_plural': 'Documents'}, + ), + migrations.AddField( + model_name='document', + name='associated_file', + field=models.FileField(blank=True, max_length=255, null=True, upload_to=ishtar_common.models.get_image_path), + ), + migrations.DeleteModel( + name='IshtarImage', + ), + ] diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 995a2c136..76f16eaae 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3096,9 +3096,9 @@ class Document(OwnPerms, ImageModel, FullSearch): LINK_SPLIT = u"<||>" - - title = models.TextField(_(u"Title"), blank=True, default='') + associated_file = models.FileField( + upload_to=get_image_path, blank=True, null=True, max_length=255) index = models.IntegerField(verbose_name=_(u"Index"), blank=True, null=True) external_id = models.TextField(_(u"External ID"), null=True, blank=True) |