def post(self): if users.get_current_user(): error_str = None max_page = str(self.request.get("max")) mainpage = self.request.get("radio") pf = PostFilter() if max_page and max_page.isdigit(): pf.setPagesize(pf, int(max_page)) pf.setMainarea(pf, mainpage) success = "Success!" else: error_str = "<p>That is not a valid number.</p>" success = None self.render_template( 'profile.html', { 'pagesize': PostFilter.page_size, "totalposts": pf.totalPosts(), "default": PostFilter.mainarea, 'currpage': '/profile', 'error': error_str, 'success': success }) else: message = "You must login to access this page".encode("utf8") self.redirect('/logout?message=' + message)
def get(self): if users.get_current_user(): pageArgs = PostFilter().loadMainPage("all", self.request.get("pg")) pageArgs['currpage'] = "/all" self.render_template('index.html', pageArgs) else: message = "You must login to access this page".encode("utf8") self.redirect('/logout?message=' + message)
def get(self): if users.get_current_user(): pf = PostFilter() self.render_template( 'profile.html', { 'pagesize': PostFilter.page_size, "totalposts": pf.totalPosts(), "default": PostFilter.mainarea, 'currpage': '/profile' }) else: message = "You must login to access this page".encode("utf8") self.redirect('/logout?message=' + message)
def get(self): pageArgs = PostFilter().loadMainPage("de_page", self.request.get("pg")) pageArgs['currpage'] = "/diet_and_excercise" self.render_template('index.html', pageArgs)
def get(self): pageArgs = PostFilter().loadMainPage("gen_page", self.request.get("pg")) pageArgs['currpage'] = "/general" self.render_template('index.html', pageArgs)
def get(self): pageArgs = PostFilter().loadMainPage(False, self.request.get("pg"), True) pageArgs['saved'] = True pageArgs['currpage'] = "/saved" self.render_template('index.html', pageArgs)
def get(self): pfilter = PostFilter() pageArgs = pfilter.loadMainPage(False, self.request.get("pg")) pageArgs['currpage'] = "/" self.render_template('index.html', pageArgs)