

def object_list(request, queryset, paginate_by=None, page=None, allow_empty=True, template_name=None, template_loader=loader, extra_context=None, context_processors=None, template_object_name='object', mimetype=None):
    '\n    Generic list of objects.\n\n    Templates: ``<app_label>/<model_name>_list.html``\n    Context:\n        object_list\n            list of objects\n        is_paginated\n            are the results paginated?\n        results_per_page\n            number of objects per page (if paginated)\n        has_next\n            is there a next page?\n        has_previous\n            is there a prev page?\n        page\n            the current page\n        next\n            the next page\n        previous\n            the previous page\n        pages\n            number of pages, total\n        hits\n            number of objects, total\n        last_on_page\n            the result number of the last of object in the\n            object_list (1-indexed)\n        first_on_page\n            the result number of the first object in the\n            object_list (1-indexed)\n        page_range:\n            A list of the page numbers (1-indexed).\n    '
    if (extra_context is None):
        extra_context = {
            
        }
    queryset = queryset._clone()
    if paginate_by:
        paginator = Paginator(queryset, paginate_by, allow_empty_first_page=allow_empty)
        if (not page):
            page = request.GET.get('page', 1)
        try:
            page_number = int(page)
        except ValueError:
            if (page == 'last'):
                page_number = paginator.num_pages
            else:
                raise Http404
        try:
            page_obj = paginator.page(page_number)
        except InvalidPage:
            raise Http404
        c = RequestContext(request, {
            ('%s_list' % template_object_name): page_obj.object_list,
            'paginator': paginator,
            'page_obj': page_obj,
            'is_paginated': page_obj.has_other_pages(),
            'results_per_page': paginator.per_page,
            'has_next': page_obj.has_next(),
            'has_previous': page_obj.has_previous(),
            'page': page_obj.number,
            'next': page_obj.next_page_number(),
            'previous': page_obj.previous_page_number(),
            'first_on_page': page_obj.start_index(),
            'last_on_page': page_obj.end_index(),
            'pages': paginator.num_pages,
            'hits': paginator.count,
            'page_range': paginator.page_range,
        }, context_processors)
    else:
        c = RequestContext(request, {
            ('%s_list' % template_object_name): queryset,
            'paginator': None,
            'page_obj': None,
            'is_paginated': False,
        }, context_processors)
        if ((not allow_empty) and (len(queryset) == 0)):
            raise Http404
    for (key, value) in extra_context.items():
        if callable(value):
            c[key] = value()
        else:
            c[key] = value
    if (not template_name):
        model = queryset.model
        template_name = ('%s/%s_list.html' % (model._meta.app_label, model._meta.object_name.lower()))
    t = template_loader.get_template(template_name)
    return HttpResponse(t.render(c), mimetype=mimetype)

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/views/generic/list_detail.py object_list/original