예제 #1
0
def add_menu(id, ru, eng, pos, bg=None, layout=LAYOUT_ONE_PAGE, index=0):
    menu = MenuModel()
    menu.link_id = id
    menu.name_ru = ru
    menu.name_en = eng
    menu.position = pos
    menu.background = bg
    menu.layout = layout
    menu.index = index
    menu.put()
예제 #2
0
def get_menus():
    menu_list = MenuModel().all()
    menu_list.order("-is_visible")
    menu_list.order("-parent_id")
    menu_list.order("-position")
    menu_list.order("index")
    return menu_list