From 911da8a2b92840f88f16266c162c4791d93422ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Padilla?= Date: Sun, 29 Mar 2015 17:04:23 -0400 Subject: [PATCH] `query_params` in favor of `QUERY_PARAMS` --- docs/api-guide/filtering.md | 2 +- docs/api-guide/generic-views.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md index b16b6be55a..50c3f2cf82 100644 --- a/docs/api-guide/filtering.md +++ b/docs/api-guide/filtering.md @@ -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 diff --git a/docs/api-guide/generic-views.md b/docs/api-guide/generic-views.md index 7df3d6ff8f..ccf84592b5 100644 --- a/docs/api-guide/generic-views.md +++ b/docs/api-guide/generic-views.md @@ -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,)