Added basic useage docs for python developers

pull/455/head
Karl Hobley 2014-07-09 15:43:07 +01:00
rodzic cb556c9ede
commit 4748684390
1 zmienionych plików z 21 dodań i 0 usunięć

Wyświetl plik

@ -7,6 +7,27 @@ Wagtailsearch: For python developers
====================================
Basic useage
============
All searches are performed on Django QuerySets:
.. code-block:: python
# Search future EventPages
>>> from wagtail.wagtailcore.models import EventPage
EventPage.objects.filter(date__gt=timezone.now()).search("Hello world!")
All methods of ``PageQuerySet`` are supported by wagtailsearch:
.. code-block:: python
# Search all live EventPages that are under the events index
>>> EventPage.objects.live().descendant_of(events_index).search("Hello")
[<EventPage: Event 1>, <EventPage: Event 2>]
Indexing extra fields
=====================