def get(self, page): try: diaries = Diary.get_diary_list(page) except Exception as e: print str(e) number = diaries.count(with_limit_and_skip=True) if number == 5: next_page = True elif number < 1: self.send_error(404) return else: next_page = False self.render('Admin/Diary/list.html', diaries=diaries, page=page, next_page=next_page)
def get(self, page): try: profile = Account.get() diaries = Diary.get_diary_list(page) categories = Category.get() except Exception as e: self.send_error(404) send_error_email('Diary List Error', str(e)) number = diaries.count(with_limit_and_skip=True) if number == 5: next_page = True elif number < 1: self.send_error(404) return else: next_page = False self.render('Diary/list.html', diaries=diaries, profile=profile, page=page, next_page=next_page, categories=categories)