Skip to content

Commit

Permalink
query_params in favor of QUERY_PARAMS
Browse files Browse the repository at this point in the history
  • Loading branch information
jpadilla committed Mar 29, 2015
1 parent ba951f3 commit 911da8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/api-guide/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ We can override `.get_queryset()` to deal with URLs such as `http://example.com/
by filtering against a `username` query parameter in the URL.
"""
queryset = Purchase.objects.all()
username = self.request.QUERY_PARAMS.get('username', None)
username = self.request.query_params.get('username', None)
if username is not None:
queryset = queryset.filter(purchaser__username=username)
return queryset
Expand Down
4 changes: 2 additions & 2 deletions docs/api-guide/generic-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ May be overridden to provide more complex behavior with filters, such as using d
For example:

def get_filter_backends(self):
if "geo_route" in self.request.QUERY_PARAMS:
if "geo_route" in self.request.query_params:
return (GeoRouteFilter, CategoryFilter)
elif "geo_point" in self.request.QUERY_PARAMS:
elif "geo_point" in self.request.query_params:
return (GeoPointFilter, CategoryFilter)

return (CategoryFilter,)
Expand Down

0 comments on commit 911da8a

Please sign in to comment.