mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-05 22:14:45 +00:00
Fix a couple of search indexing examples
This commit is contained in:
parent
d0670da61b
commit
df4f1204e8
1 changed files with 6 additions and 2 deletions
|
|
@ -115,7 +115,9 @@ For example, if we have a book that has a ``ForeignKey`` to its author, we can n
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
class Book(models.Model, indexed.Indexed):
|
||||
from wagtail.search import index
|
||||
|
||||
class Book(models.Model, index.Indexed):
|
||||
...
|
||||
|
||||
search_fields = [
|
||||
|
|
@ -134,7 +136,9 @@ It works the other way around as well. You can index an author's books, allowing
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
class Author(models.Model, indexed.Indexed):
|
||||
from wagtail.search import index
|
||||
|
||||
class Author(models.Model, index.Indexed):
|
||||
...
|
||||
|
||||
search_fields = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue