mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
no longer tightly coupled to private queryset API
This commit is contained in:
parent
19b8f779de
commit
55650a743d
|
@ -3,6 +3,7 @@ Generic views that provide commonly needed behaviour.
|
|||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db.models.query import QuerySet
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.core.paginator import Paginator, InvalidPage
|
||||
from django.http import Http404
|
||||
|
@ -214,7 +215,9 @@ class GenericAPIView(views.APIView):
|
|||
% self.__class__.__name__
|
||||
)
|
||||
|
||||
return self.queryset._clone()
|
||||
if isinstance(self.queryset, QuerySet):
|
||||
return self.queryset.all()
|
||||
return self.queryset
|
||||
|
||||
def get_object(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user