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()
Exemple #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