示例#1
0
def backgrounds(request):
    backgrounds = db.Query(Background)

    page = request.GET.get('page', 1)

    p = GAEPaginator(backgrounds, 20)

    try:
        results = p.page(page)
    except (EmptyPage, InvalidPage):
        results = p.page(p.num_pages)

    context = {
        'title': 'Fanmento Administration - Backgrounds',
        'name': request.user.email,
        'page': results,
        'active': 'backgrounds',
    }
    context.update(csrf(request))
    return render_to_response('background_list.html', context)
示例#2
0
def backgrounds(request):
    backgrounds = db.Query(Background)

    page = request.GET.get('page', 1)

    p = GAEPaginator(backgrounds, 20)

    try:
        results = p.page(page)
    except (EmptyPage, InvalidPage):
        results = p.page(p.num_pages)

    context = {
        'title': 'Fanmento Administration - Backgrounds',
        'name': request.user.email,
        'page': results,
        'active': 'backgrounds',
    }
    context.update(csrf(request))
    return render_to_response('background_list.html', context)
示例#3
0
def users(request):
    order = request.GET.get('sort', 'name')
    users = db.Query(User).order(order)

    page = request.GET.get('page', 1)

    p = GAEPaginator(users, 20)

    try:
        results = p.page(page)
    except (EmptyPage, InvalidPage):
        results = p.page(p.num_pages)

    context = {
        'title': 'Fanmento Administration - Users',
        'name': request.user.email,
        'page': results,
        'sort': order,
        'active': 'users',
    }
    context.update(csrf(request))

    return render_to_response('users_list.html', context)
示例#4
0
def users(request):
    order = request.GET.get('sort', 'name')
    users = db.Query(User).order(order)

    page = request.GET.get('page', 1)

    p = GAEPaginator(users, 20)

    try:
        results = p.page(page)
    except (EmptyPage, InvalidPage):
        results = p.page(p.num_pages)

    context = {
        'title': 'Fanmento Administration - Users',
        'name': request.user.email,
        'page': results,
        'sort': order,
        'active': 'users',
    }
    context.update(csrf(request))

    return render_to_response('users_list.html', context)