aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2012-11-07 21:28:10 +0000
committerTom Christie2012-11-07 21:28:10 +0000
commit34c5fb0cc682831822ce77379e8211ec02349897 (patch)
tree838e470306a56f5cb8764cb3340e7eb74c63f954
parent9fe317b2caee8e397ae669fb0d99c5fb730f7819 (diff)
downloaddjango-rest-framework-34c5fb0cc682831822ce77379e8211ec02349897.tar.bz2
Add filtering into documentation
-rw-r--r--docs/api-guide/filtering.md8
-rw-r--r--docs/index.md2
-rw-r--r--docs/template.html1
3 files changed, 11 insertions, 0 deletions
diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md
index 7f6a9c97..ea1e7d23 100644
--- a/docs/api-guide/filtering.md
+++ b/docs/api-guide/filtering.md
@@ -1,3 +1,5 @@
+<a class="github" href="filters.py"></a>
+
# 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 5e086872..52ea2b75 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 c428dff3..676a4807 100644
--- a/docs/template.html
+++ b/docs/template.html
@@ -75,6 +75,7 @@
<li><a href="{{ base_url }}/api-guide/authentication{{ suffix }}">Authentication</a></li>
<li><a href="{{ base_url }}/api-guide/permissions{{ suffix }}">Permissions</a></li>
<li><a href="{{ base_url }}/api-guide/throttling{{ suffix }}">Throttling</a></li>
+ <li><a href="{{ base_url }}/api-guide/filtering{{ suffix }}">Filtering</a></li>
<li><a href="{{ base_url }}/api-guide/pagination{{ suffix }}">Pagination</a></li>
<li><a href="{{ base_url }}/api-guide/content-negotiation{{ suffix }}">Content negotiation</a></li>
<li><a href="{{ base_url }}/api-guide/format-suffixes{{ suffix }}">Format suffixes</a></li>