def GET(self,slug=None): self.render2('views/admin/links.html', { 'current':'links', 'links':Link.all().filter('linktype =','blogroll')#.order('-createdate') } )
def admin_list_link(request): if users.is_current_user_admin(): return object_list(request, template_object_name='obj', queryset=Link.all(), allow_empty=True, extra_context={'type': 'link'}, template_name='admin/list.html', paginate_by=setting.ADMIN_LIST_PER_PAGE, ) else: return HttpResponseRedirect('/')
def admin_list_link(request): if users.is_current_user_admin(): return object_list( request, template_object_name='obj', queryset=Link.all(), allow_empty=True, extra_context={'type': 'link'}, template_name='admin/list.html', paginate_by=setting.ADMIN_LIST_PER_PAGE, ) else: return HttpResponseRedirect('/')
def initialize(self, request): m_pages=Entry.all().filter('entrytype =','page')\ .filter('published =',True)\ .filter('entry_parent =',0)\ .order('menu_order') blogroll=Link.all().filter('linktype =','blogroll') archives=Archive.all().order('-year').order('-month').fetch(12) alltags=Tag.all() self.template_vals.update({ 'menu_pages':m_pages, 'categories':Category.all(), 'blogroll':blogroll, 'archives':archives, 'alltags':alltags, 'recent_comments':Comment.all().order('-date').fetch(5) })
def initialize(self, request): BaseRequestHandler.initialize(self,request) m_pages=Entry.all().filter(entrytype = 'page') \ .filter(published = True)\ .filter(entry_parent = 0)\ .order_by('menu_order') blogroll=Link.all().filter(linktype = 'blogroll') #archives=Archive.all().order_by('-year').order_by('-month').fetch(12) archives=Archive.all().order_by('-year', '-month')[0:12] alltags=Tag.all() self.template_vals.update({ 'menu_pages':m_pages, 'categories':Category.all(), 'blogroll':blogroll, 'archives':archives, 'alltags':alltags, 'recent_comments':Comment.all().order_by('-date')[0:5]#.fetch(5) })
def wwb_list_link(): html = '' for link in Link.all(): html += '<li><a href=\"%s">%s</a></li>' % (link.link.encode('utf-8'), link.title.encode('utf-8')) return html
def wwb_list_link(): html = '' for link in Link.all(): html += '<li><a href=\"%s">%s</a></li>'%(link.link.encode('utf-8'), link.title.encode('utf-8')) return html