diff options
| author | Carlton Gibson | 2014-04-09 10:06:35 +0200 |
|---|---|---|
| committer | Carlton Gibson | 2014-04-09 10:06:35 +0200 |
| commit | b0ba8d61ecf3c74470fa6ac019caff1fd4ca1be6 (patch) | |
| tree | 43c843ee812d1e4c8d3f7de7dcb6824d0313fc69 | |
| parent | 4495ac466d5b3d4439138bd80f71fd33c922519e (diff) | |
| parent | 3234a5dd6b0c090dd25a716e7b1c2567d8fee89b (diff) | |
| download | django-rest-framework-b0ba8d61ecf3c74470fa6ac019caff1fd4ca1be6.tar.bz2 | |
Merge pull request #1514 from craigatron/master
Fix python syntax in filtering docs
| -rw-r--r-- | docs/api-guide/filtering.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md index d6c4b1c1..6a8a267b 100644 --- a/docs/api-guide/filtering.md +++ b/docs/api-guide/filtering.md @@ -24,7 +24,7 @@ For example: from myapp.serializers import PurchaseSerializer from rest_framework import generics - class PurchaseList(generics.ListAPIView) + class PurchaseList(generics.ListAPIView): serializer_class = PurchaseSerializer def get_queryset(self): @@ -46,7 +46,7 @@ For example if your URL config contained an entry like this: You could then write a view that returned a purchase queryset filtered by the username portion of the URL: - class PurchaseList(generics.ListAPIView) + class PurchaseList(generics.ListAPIView): serializer_class = PurchaseSerializer def get_queryset(self): @@ -63,7 +63,7 @@ A final example of filtering the initial queryset would be to determine the init We can override `.get_queryset()` to deal with URLs such as `http://example.com/api/purchases?username=denvercoder9`, and filter the queryset only if the `username` parameter is included in the URL: - class PurchaseList(generics.ListAPIView) + class PurchaseList(generics.ListAPIView): serializer_class = PurchaseSerializer def get_queryset(self): |
