mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-04-01 21:00:24 +00:00
Added doc to get_queryset.
This commit is contained in:
parent
0a77e54b59
commit
8cb1b0d82f
1 changed files with 10 additions and 0 deletions
|
|
@ -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.')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue