def list(request, page=1, template='contacts/group/list.html'):

    group_list = Group.objects.all()
    paginator = Paginator(group_list, 20)

    try:
        groups = paginator.page(page)
    except (EmptyPage, InvalidPage):
        groups = paginator.page(paginator.num_pages)

    kwvars = {
        'object_list': groups.object_list,
        'has_next': groups.has_next(),
        'has_previous': groups.has_previous(),
        'has_other_pages': groups.has_other_pages(),
        'start_index': groups.start_index(),
        'end_index': groups.end_index(),
    }

    try:
        kwvars['previous_page_number'] = groups.previous_page_number()
    except (EmptyPage, InvalidPage):
        kwvars['previous_page_number'] = None
    try:
        kwvars['next_page_number'] = groups.next_page_number()
    except (EmptyPage, InvalidPage):
        kwvars['next_page_number'] = None

    return render_to_response(template, kwvars, RequestContext(request))
A L{WrittenAction} can be constructed from a single "end"
dataset/ETHPy150Open myles/django-contacts/src/contacts/views/group.py/list--crossover with--dataset/ETHPy150Open ClusterHQ/eliot/eliot/tests/test_action.py/WrittenActionTests.test_from_single_end_message