From 34c5fb0cc682831822ce77379e8211ec02349897 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 7 Nov 2012 21:28:10 +0000 Subject: [PATCH] Add filtering into documentation --- docs/api-guide/filtering.md | 8 ++++++++ docs/index.md | 2 ++ docs/template.html | 1 + 3 files changed, 11 insertions(+) diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md index 7f6a9c970..ea1e7d23e 100644 --- a/docs/api-guide/filtering.md +++ b/docs/api-guide/filtering.md @@ -1,3 +1,5 @@ + + # Filtering > The root QuerySet provided by the Manager describes all objects in the database table. Usually, though, you'll need to select only a subset of the complete set of objects. @@ -74,6 +76,8 @@ We can override `.get_queryset()` to deal with URLs such as `http://example.com/ queryset = queryset.filter(purchaser__username=username) return queryset +--- + # Generic Filtering As well as being able to override the default queryset, REST framework also includes support for generic filtering backends that allow you to easily construct complex filters that can be specified by the client using query parameters. @@ -96,6 +100,10 @@ To use REST framework's default filtering backend, first install `django-filter` **TODO**: Note support for `lookup_type`, double underscore relationship spanning, and ordering. +**TODO**: Note that overiding `get_queryset()` can be used together with generic filtering + +--- + # Custom generic filtering You can also provide your own generic filtering backend, or write an installable app for other developers to use. diff --git a/docs/index.md b/docs/index.md index 5e0868724..52ea2b75e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -95,6 +95,7 @@ The API guide is your complete reference manual to all the functionality provide * [Authentication][authentication] * [Permissions][permissions] * [Throttling][throttling] +* [Filtering][filtering] * [Pagination][pagination] * [Content negotiation][contentnegotiation] * [Format suffixes][formatsuffixes] @@ -184,6 +185,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [authentication]: api-guide/authentication.md [permissions]: api-guide/permissions.md [throttling]: api-guide/throttling.md +[filtering]: api-guide/filtering.md [pagination]: api-guide/pagination.md [contentnegotiation]: api-guide/content-negotiation.md [formatsuffixes]: api-guide/format-suffixes.md diff --git a/docs/template.html b/docs/template.html index c428dff3a..676a48070 100644 --- a/docs/template.html +++ b/docs/template.html @@ -75,6 +75,7 @@
  • Authentication
  • Permissions
  • Throttling
  • +
  • Filtering
  • Pagination
  • Content negotiation
  • Format suffixes