Added doc to get_queryset.

This commit is contained in:
AppleGrew 2013-09-27 20:04:06 +05:30
parent 0a77e54b59
commit 8cb1b0d82f

View file

@ -145,6 +145,16 @@ class ModelResultJsonMixin(object):
super(ModelResultJsonMixin, self).__init__(*args, **kwargs)
def get_queryset(self):
"""
Returns the queryset.
The default implementation returns the ``self.queryset``, which is usually the
one set by sub-classes at class-level. However, if that is ``None``
then ``ValueError`` is thrown.
:return: queryset
:rtype: :py:class:`django.db.models.QuerySet`
"""
if self.queryset is None:
raise ValueError('queryset is required.')