예제 #1
0
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
예제 #2
0
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()
예제 #3
0
 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))
예제 #4
0
def get_blog_pages():
    page_list = PageModel().all()
    page_list.order("-date")    
    page_list.filter("fk_menu in", ["welcome" , "blog"])
    return page_list