Esempio n. 1
0
def admin_index(request, page="1"):
    """
    Loads the Administration panel for the Video Posts.
    """
    variables = dict()
    videopost_list = VideoPost.objects.all().order_by('-publication_date')
    max_results = 10
    if videopost_list:
        paginator_results, videoposts = paginator_numeric(videopost_list, max_results, page)
        variables.update(paginator_results)
        variables['videoposts'] = videoposts.object_list
        variables['pagination_list'] = videoposts
        variables['title'] = "Video Posts"
    else:
        messages.info(request, _('No Results Found.'))
    t = get_template('videopost/admin/list.html')
    html = t.render(RequestContext(request, variables))
    return HttpResponse(html)
Esempio n. 2
0
def admin_index(request, page="1"):
    """
    Loads the Administration panel for the Video Posts.
    """
    variables = dict()
    videopost_list = VideoPost.objects.all().order_by('-publication_date')
    max_results = 10
    if videopost_list:
        paginator_results, videoposts = paginator_numeric(
            videopost_list, max_results, page)
        variables.update(paginator_results)
        variables['videoposts'] = videoposts.object_list
        variables['pagination_list'] = videoposts
        variables['title'] = "Video Posts"
    else:
        messages.info(request, _('No Results Found.'))
    t = get_template('videopost/admin/list.html')
    html = t.render(RequestContext(request, variables))
    return HttpResponse(html)
Esempio n. 3
0
def admin_index(request, page="1"):
    """
    Loads the Administration panel for the Tags.
    URL: ^admin/tag/$
    """
    variables = dict()
    tag_list = Tag.objects.all()
    max_results = 10
    if tag_list:
        paginator_results, tags = paginator_numeric(tag_list, max_results, page)
        variables.update(paginator_results)
        variables['tags'] = tags.object_list
        variables['pagination_list'] = tags
        variables['title'] = "Tags"
    else:
        messages.warning(request, _('No Results Found.'))
    t = get_template('tag/admin/list.html')
    html = t.render(RequestContext(request, variables))
    return HttpResponse(html)
Esempio n. 4
0
def admin_index(request, page="1"):
    """
    Loads the Administration panel for the Tags.
    URL: ^admin/tag/$
    """
    variables = dict()
    tag_list = Tag.objects.all()
    max_results = 10
    if tag_list:
        paginator_results, tags = paginator_numeric(tag_list, max_results,
                                                    page)
        variables.update(paginator_results)
        variables['tags'] = tags.object_list
        variables['pagination_list'] = tags
        variables['title'] = "Tags"
    else:
        messages.warning(request, _('No Results Found.'))
    t = get_template('tag/admin/list.html')
    html = t.render(RequestContext(request, variables))
    return HttpResponse(html)