def get_list_or_404(klass, *args, **kwargs):
 queryset = _get_queryset(klass)
 try:
  obj_list = list(queryset.filter(*args, **kwargs))
 except AttributeError:
  klass__name = (klass.__name__ if isinstance(klass, type) else klass.__class__.__name__)
  raise ValueError(("First argument to get_list_or_404() must be a Model, Manager, or QuerySet, not '%s'." % klass__name))
 if (not obj_list):
  raise Http404(('No %s matches the given query.' % queryset.model._meta.object_name))
 return obj_list

def get_list_or_404 ( klass , * args , ** kwargs ) : queryset = _get_queryset ( klass ) try : obj_list = list ( queryset . filter ( * args , ** kwargs ) ) except AttributeError : klass__name = ( klass . __name__ if isinstance ( klass , type ) else klass . __class__ . __name__ ) raise ValueError ( ( "First argument to get_list_or_404() must be a Model, Manager, or QuerySet, not '%s'." % klass__name ) ) if ( not obj_list ) : raise Http404 ( ( 'No %s matches the given query.' % queryset . model . _meta . object_name ) ) return obj_list
uses filter() to return a list of objects .