

def _get_queryset(klass):
    '\n    Returns a QuerySet from a Model, Manager, or QuerySet. Created to make\n    get_object_or_404 and get_list_or_404 more DRY.\n    '
    if isinstance(klass, QuerySet):
        return klass
    elif isinstance(klass, Manager):
        manager = klass
    else:
        manager = klass._default_manager
    return manager.all()

dataset/ETHPy150Open dcramer/django-compositepks/django/shortcuts/__init__.py _get_queryset/original