Update documentation and code to put mixin first

pull/2568/head
Josh Schneier 2016-04-03 16:28:37 -04:00 zatwierdzone przez Karl Hobley
rodzic 629deeba68
commit 6d1a9efbb6
8 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -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)

Wyświetl plik

@ -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)

Wyświetl plik

@ -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',

Wyświetl plik

@ -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),
),
]

Wyświetl plik

@ -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 = [

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -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,