'Store the original class on the view function.
This allows us to discover information about the view when we do URL
reverse lookups.  Used for breadcrumb generation.'

@classmethod
def as_view(cls, **initkwargs):

    if isinstance(getattr(cls, u'queryset', None), models.query.QuerySet):
        def force_evaluation():
            raise RuntimeError(u'Do    not    evaluate    the    `.queryset`    attribute    directly,    as    the    result    will    be    cached    and    reused    between    requests.    Use    `.all()`    or    call    `.get_queryset()`    instead.')
        cls.queryset._fetch_all = force_evaluation
    view = super(APIView, cls).as_view(**initkwargs)
    view.cls = cls
    view.initkwargs = initkwargs
    return csrf_exempt(view)
