def get_queryset(self):
        if self.queryset is not None:
            queryset = self.queryset
        elif self.model is not None:
            queryset = self.model._default_manager.all()
        else:
            raise NotImplementedError(
                "%(cls)s is missing a QuerySet. Define "
                "%(cls)s.model, %(cls)s.queryset, or override "
                "%(cls)s.get_queryset()." % {
                    'cls': self.__class__.__name__
                }
            )
        return queryset
Return QuerySet based on :attr:`.queryset` or :attr:`.model`.
dataset/ETHPy150Open applegrew/django-select2/django_select2/forms.py/ModelSelect2Mixin.get_queryset