TagSearchable needs to be removed from migrations

This commit is contained in:
Matt Westcott 2016-06-10 17:01:22 +01:00 committed by Karl Hobley
parent ea7a9a29f6
commit 367c71dbaa
4 changed files with 34 additions and 7 deletions

View file

@ -45,3 +45,30 @@ The ``choices`` field on the ``wagtailforms.models.AbstractFormField`` model has
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``wagtailimages.Filter`` model has been removed, and replaced with a ``Filter`` class instead. This class can be imported from the same location as the model: ``wagtail.wagtailimages.models.Filter``. The ``Filter`` class has the same API as the ``Filter`` model did, with the exception that Model methods such as ``Filter.save()``, and ``Filter.objects.get()`` have been removed.
``TagSearchable`` needs removing from custom image / document model migrations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The mixin class ``wagtail.wagtailadmin.taggable.TagSearchable``, used internally by image and document models, has been deprecated. If you are using custom image or document models in your project, the migration(s) which created them will contain frozen references to ``wagtail.wagtailadmin.taggable.TagSearchable``, which must now be removed. The line:
.. code-block:: python
import wagtail.wagtailadmin.taggable
should be replaced by:
.. code-block:: python
import wagtail.wagtailsearch.index
and the line:
.. code-block:: python
bases=(models.Model, wagtail.wagtailadmin.taggable.TagSearchable),
should be updated to:
.. code-block:: python
bases=(models.Model, wagtail.wagtailsearch.index.Indexed),

View file

@ -9,11 +9,11 @@ import taggit.managers
from django.conf import settings
from django.db import migrations, models
import wagtail.wagtailadmin.taggable
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
import wagtail.wagtailimages.models
import wagtail.wagtailsearch.index
class Migration(migrations.Migration):
@ -145,7 +145,7 @@ class Migration(migrations.Migration):
options={
'abstract': False,
},
bases=(models.Model, wagtail.wagtailadmin.taggable.TagSearchable),
bases=(models.Model, wagtail.wagtailsearch.index.Indexed),
),
migrations.CreateModel(
name='CustomImageFilePath',
@ -167,7 +167,7 @@ class Migration(migrations.Migration):
options={
'abstract': False,
},
bases=(models.Model, wagtail.wagtailadmin.taggable.TagSearchable),
bases=(models.Model, wagtail.wagtailsearch.index.Indexed),
),
migrations.CreateModel(
name='CustomManagerPage',

View file

@ -5,7 +5,7 @@ import taggit.managers
from django.conf import settings
from django.db import migrations, models
import wagtail.wagtailadmin.taggable
import wagtail.wagtailsearch.index
class Migration(migrations.Migration):
@ -46,6 +46,6 @@ class Migration(migrations.Migration):
],
options={
},
bases=(models.Model, wagtail.wagtailadmin.taggable.TagSearchable),
bases=(models.Model, wagtail.wagtailsearch.index.Indexed),
),
]

View file

@ -5,8 +5,8 @@ import taggit.managers
from django.conf import settings
from django.db import migrations, models
import wagtail.wagtailadmin.taggable
import wagtail.wagtailimages.models
import wagtail.wagtailsearch.index
class Migration(migrations.Migration):
@ -54,7 +54,7 @@ class Migration(migrations.Migration):
options={
'abstract': False,
},
bases=(models.Model, wagtail.wagtailadmin.taggable.TagSearchable),
bases=(models.Model, wagtail.wagtailsearch.index.Indexed),
),
migrations.CreateModel(
name='Rendition',