def _get_queryset(klass):
if isinstance(klass, QuerySet):<EOL><INDENT>return klass<EOL><DEDENT>elif isinstance(klass, Manager):<EOL><INDENT>manager = klass<EOL><DEDENT>elif isinstance(klass, ModelBase):<EOL><INDENT>manager = klass._default_manager<EOL><DEDENT>else:<EOL><INDENT>if isinstance(klass, type):<EOL><INDENT>klass__name = klass.__name__<EOL><DEDENT>else:<EOL><INDENT>klass__name = klass.__class__.__name__<EOL><DEDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(klass__name)<EOL>)<EOL><DEDENT>return manager.all()<EOL>
Returns a QuerySet from a Model, Manager, or QuerySet. Created to make
get_object_or_404 and get_list_or_404 more DRY.

Raises a ValueError if klass is not a Model, Manager, or QuerySet.