Remove 'filter' FK from AbstractRendition

Third stage of #2881; cannot remove Filter model yet, as per https://github.com/wagtail/wagtail/pull/3224#issuecomment-267649763
pull/3226/head
Matt Westcott 2016-12-16 17:17:44 +00:00
rodzic 5e13a1d674
commit 6aff245474
2 zmienionych plików z 24 dodań i 6 usunięć

Wyświetl plik

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-16 17:15
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0016_deprecate_rendition_filter_relation'),
]
operations = [
migrations.RemoveField(
model_name='rendition',
name='filter',
),
]

Wyświetl plik

@ -365,7 +365,7 @@ def image_delete(sender, instance, **kwargs):
instance.file.delete(False)
# RemovedInWagtail19Warning: We will remove the models.Model
# RemovedInWagtail110Warning: We will remove the models.Model
class Filter(models.Model):
"""
Represents one or more operations that can be applied to an Image to produce a rendition
@ -485,9 +485,9 @@ class Filter(models.Model):
def save(self, *args, **kwargs):
warnings.warn(
"Filter.save() is deprecated; Filter will no longer be an ORM model in Wagtail 1.9. "
"Filter.save() is deprecated; Filter will no longer be an ORM model in Wagtail 1.10. "
"Instantiate and use it in-memory instead",
RemovedInWagtail19Warning, stacklevel=2
RemovedInWagtail110Warning, stacklevel=2
)
return super(Filter, self).save(*args, **kwargs)
@ -495,9 +495,9 @@ class Filter(models.Model):
class WarnOnManagerAccess(object):
def __get__(self, obj, objtype=None):
warnings.warn(
"Filter.objects is deprecated; Filter will no longer be an ORM model in Wagtail 1.9. "
"Filter.objects is deprecated; Filter will no longer be an ORM model in Wagtail 1.10. "
"Instantiate and use it in-memory instead",
RemovedInWagtail19Warning, stacklevel=2
RemovedInWagtail110Warning, stacklevel=2
)
return objtype._objects
@ -507,7 +507,6 @@ Filter.objects = WarnOnManagerAccess()
class AbstractRendition(models.Model):
filter = models.ForeignKey(Filter, related_name='+', null=True, blank=True) # DEPRECATED - RemovedInWagtail19Warning
filter_spec = models.CharField(max_length=255, db_index=True)
file = models.ImageField(upload_to=get_rendition_upload_to, width_field='width', height_field='height')
width = models.IntegerField(editable=False)