if self.queryset is not None:
    queryset = self.queryset
if hasattr(queryset, '_clone'):
    queryset = queryset._clone()
elif self.model is not None:
    queryset = self.model._default_manager.all()
else:
    raise ImproperlyConfigured("'%s' must define 'queryset' or 'model'" %
        self.__class__.__name__)
return queryset
Django - queryset vs model in Generic View