Fix Django 1.5/1.4 compat issue

This commit is contained in:
Tom Christie 2015-07-24 09:02:16 +01:00
parent c0e3e670ca
commit 108dfafa44

View File

@ -126,8 +126,8 @@ class APIView(View):
'as the result will be cached and reused between requests. '
'Use `.all()` or call `.get_queryset()` instead.'
)
cls.queryset._fetch_all = force_evaluation
cls.queryset._result_iter = force_evaluation # Django <= 1.5
view = super(APIView, cls).as_view(**initkwargs)
view.cls = cls