def render(self): posts = [] for i in range(self.RECENT_POSTS_PAGES): posts = posts + meidodb.select_entries(i) l = [ '<li><a href="/blog/{0}">{1}</a></li>'.format( post['id'], post['title']) for post in posts ] return ''.join(l)
def render(self): posts = [] for i in range(self.RECENT_POSTS_PAGES): posts = posts + meidodb.select_entries(i) l = ['<li><a href="/blog/{0}">{1}</a></li>'.format( post['id'], post['title']) for post in posts] return ''.join(l)
def get(self): # default is page 0 page = int(self.get_argument("page", "0")) pages_max = meidodb.pages_max() if page > pages_max: page = pages_max # if the database hasn't initialized go to siteinfo page first if None == meidodb.get_siteinfo("password"): self.redirect("/blog-admin/siteinfo") return bloglist = meidodb.select_entries(page) self._meido_render( content_type="bloglist", blogentries=bloglist, pages_max=pages_max, page=page, category=None, post_date=None )
def get(self): # default is page 0 page = int(self.get_argument('page', '0')) pages_max = meidodb.pages_max() if page > pages_max: page = pages_max # if the database hasn't initialized go to siteinfo page first if None == meidodb.get_siteinfo('password'): self.redirect('/blog-admin/siteinfo') return bloglist = meidodb.select_entries(page) self._meido_render(content_type='bloglist', blogentries=bloglist, pages_max=pages_max, page=page, category=None, post_date=None)