示例#1
0
def about(request):
    post = Page.all().get()
    if post:
        return render_to_response('single.html',
                              dictionary = { "post" : Page.all().get() },
                              )
    else:
        return HttpResponseRedirect('/')
示例#2
0
def admin_list_page(request):
    if users.is_current_user_admin():
        
        return object_list(request,
                       template_object_name='obj',
                       queryset=Page.all().order('-create_time'),
                       allow_empty=True,
                       extra_context={'type': 'page'},
                       template_name='admin/list.html',
                       paginate_by=setting.ADMIN_LIST_PER_PAGE,
                       )
    else:
        return HttpResponseRedirect('/')
示例#3
0
def admin_list_page(request):
    if users.is_current_user_admin():

        return object_list(
            request,
            template_object_name='obj',
            queryset=Page.all().order('-create_time'),
            allow_empty=True,
            extra_context={'type': 'page'},
            template_name='admin/list.html',
            paginate_by=setting.ADMIN_LIST_PER_PAGE,
        )
    else:
        return HttpResponseRedirect('/')
示例#4
0
def wwb_list_page():
    html = ''
    for page in Page.all()[:10]:
        html += '<li><a href=\"%s">%s</a></li>' % (page.get_absolute_url(),
                                                   page.title.encode('utf-8'))
    return html
示例#5
0
def wwb_list_page():   
    html = ''
    for page in Page.all()[:10]:
        html += '<li><a href=\"%s">%s</a></li>'%(page.get_absolute_url(), page.title.encode('utf-8'))
    return html