add note about Wagtail <=1.4 syntax for search_fields

pull/2552/head
Matt Westcott 2016-05-02 18:42:21 +01:00
rodzic 020279a8a6
commit b39ff4a134
1 zmienionych plików z 12 dodań i 0 usunięć

Wyświetl plik

@ -173,6 +173,18 @@ The following example defines a basic blog post model in ``blog/models.py``:
FieldPanel('body', classname="full") FieldPanel('body', classname="full")
] ]
.. note::
On Wagtail versions before 1.5, ``search_fields`` needs to be defined as a tuple:
.. code-block:: python
search_fields = Page.search_fields + (
index.SearchField('intro'),
index.SearchField('body'),
)
Create a template at ``blog/templates/blog/blog_page.html``: Create a template at ``blog/templates/blog/blog_page.html``:
.. code-block:: html+django .. code-block:: html+django