mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Merge d7799c32c8
into 836e49b535
This commit is contained in:
commit
200584a93a
|
@ -74,7 +74,7 @@ class GenericAPIView(views.APIView):
|
||||||
queryset = queryset.all()
|
queryset = queryset.all()
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
def get_object(self):
|
def get_object(self, queryset=None):
|
||||||
"""
|
"""
|
||||||
Returns the object the view is displaying.
|
Returns the object the view is displaying.
|
||||||
|
|
||||||
|
@ -82,6 +82,9 @@ class GenericAPIView(views.APIView):
|
||||||
queryset lookups. Eg if objects are referenced using multiple
|
queryset lookups. Eg if objects are referenced using multiple
|
||||||
keyword arguments in the url conf.
|
keyword arguments in the url conf.
|
||||||
"""
|
"""
|
||||||
|
if queryset is not None:
|
||||||
|
queryset = self.filter_queryset(queryset)
|
||||||
|
else:
|
||||||
queryset = self.filter_queryset(self.get_queryset())
|
queryset = self.filter_queryset(self.get_queryset())
|
||||||
|
|
||||||
# Perform the lookup filtering.
|
# Perform the lookup filtering.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user