def get_pages(menu_name=None): page_list = PageModel().all() page_list.order("-is_visible") page_list.order("fk_menu") page_list.order("index") page_list.order("-date") if menu_name: page_list.filter("fk_menu", menu_name) return page_list
def add_page(title, content, menu): page = PageModel() page.title_ru = title page.title_en = get_translated(title) page.content_ru = content page.content_en = get_translated(content) page.fk_menu = menu page.put()
def get(self): models = PageModel().all() models.order('-date') models.filter('fk_menu', "blog") models.fetch(20) lang = self.request.get('lang') template_values = { 'lang':lang, 'date': datetime, 'models': models, } path = os.path.join(os.path.dirname(__file__), 'rss.xml') self.response.out.write(template.render(path, template_values))
def get_blog_pages(): page_list = PageModel().all() page_list.order("-date") page_list.filter("fk_menu in", ["welcome" , "blog"]) return page_list