diff --git a/docs/topics/search/indexing.rst b/docs/topics/search/indexing.rst index a24d1415b..49e2a2053 100644 --- a/docs/topics/search/indexing.rst +++ b/docs/topics/search/indexing.rst @@ -216,7 +216,7 @@ To do this, inherit from ``index.Indexed`` and add some ``search_fields`` to the from wagtail.wagtailsearch import index - class Book(models.Model, index.Indexed): + class Book(index.Indexed, models.Model): title = models.CharField(max_length=255) genre = models.CharField(max_length=255, choices=GENRE_CHOICES) author = models.ForeignKey(Author) diff --git a/docs/topics/snippets.rst b/docs/topics/snippets.rst index ee4c640eb..19165d9bc 100644 --- a/docs/topics/snippets.rst +++ b/docs/topics/snippets.rst @@ -191,7 +191,7 @@ If a snippet model inherits from ``wagtail.wagtailsearch.index.Indexed``, as des ... @register_snippet - class Advert(models.Model, index.Indexed): + class Advert(index.Indexed, models.Model): url = models.URLField(null=True, blank=True) text = models.CharField(max_length=255) diff --git a/wagtail/tests/search/migrations/0001_initial.py b/wagtail/tests/search/migrations/0001_initial.py index 7421604f2..a8d8b81d5 100644 --- a/wagtail/tests/search/migrations/0001_initial.py +++ b/wagtail/tests/search/migrations/0001_initial.py @@ -28,7 +28,7 @@ class Migration(migrations.Migration): ('live', models.BooleanField(default=False)), ('published_date', models.DateField(null=True)), ], - bases=(models.Model, wagtail.wagtailsearch.index.Indexed), + bases=(wagtail.wagtailsearch.index.Indexed, models.Model), ), migrations.CreateModel( name='SearchTestChild', diff --git a/wagtail/tests/snippets/migrations/0002_searchablesnippet.py b/wagtail/tests/snippets/migrations/0002_searchablesnippet.py index 5a3da3b76..563fb6b6e 100644 --- a/wagtail/tests/snippets/migrations/0002_searchablesnippet.py +++ b/wagtail/tests/snippets/migrations/0002_searchablesnippet.py @@ -19,6 +19,6 @@ class Migration(migrations.Migration): ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), ('text', models.CharField(max_length=255)), ], - bases=(models.Model, wagtail.wagtailsearch.index.Indexed), + bases=(wagtail.wagtailsearch.index.Indexed, models.Model), ), ] diff --git a/wagtail/tests/snippets/models.py b/wagtail/tests/snippets/models.py index 56d06be61..bacf67400 100644 --- a/wagtail/tests/snippets/models.py +++ b/wagtail/tests/snippets/models.py @@ -47,7 +47,7 @@ class RegisterDecorator(models.Model): # A snippet model that inherits from index.Indexed can be searched on @register_snippet -class SearchableSnippet(models.Model, index.Indexed): +class SearchableSnippet(index.Indexed, models.Model): text = models.CharField(max_length=255) search_fields = [ diff --git a/wagtail/wagtailcore/migrations/0001_initial.py b/wagtail/wagtailcore/migrations/0001_initial.py index a6d5fd3c9..224c380f2 100644 --- a/wagtail/wagtailcore/migrations/0001_initial.py +++ b/wagtail/wagtailcore/migrations/0001_initial.py @@ -96,7 +96,7 @@ class Migration(migrations.Migration): options={ 'abstract': False, }, - bases=(models.Model, wagtail.wagtailsearch.index.Indexed), + bases=(wagtail.wagtailsearch.index.Indexed, models.Model), ), migrations.RunPython( set_page_path_collation, migrations.RunPython.noop diff --git a/wagtail/wagtailcore/migrations/0001_squashed_0016_change_page_url_path_to_text_field.py b/wagtail/wagtailcore/migrations/0001_squashed_0016_change_page_url_path_to_text_field.py index d3a73ad17..ae014e84f 100644 --- a/wagtail/wagtailcore/migrations/0001_squashed_0016_change_page_url_path_to_text_field.py +++ b/wagtail/wagtailcore/migrations/0001_squashed_0016_change_page_url_path_to_text_field.py @@ -240,7 +240,7 @@ class Migration(migrations.Migration): options={ 'abstract': False, }, - bases=(models.Model, wagtail.wagtailsearch.index.Indexed), + bases=(wagtail.wagtailsearch.index.Indexed, models.Model), ), migrations.RunPython( set_page_path_collation, migrations.RunPython.noop diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index dade18d8c..f35e93ac8 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -290,7 +290,7 @@ class PageBase(models.base.ModelBase): @python_2_unicode_compatible -class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed)): +class Page(six.with_metaclass(PageBase, MP_Node, index.Indexed, ClusterableModel)): title = models.CharField( verbose_name=_('title'), max_length=255,