def get_page(self): """ Returns the page this Menu belongs To """ if self._page is None or self._page.get_id() != self._page_id: self._page = Page.get_page(self._page_id) return self._page
def getMenusOfSite(self,params): page_id = int(params[0]) page = Page.get_page(page_id) menus = page.get_menus() ret = [] for menu in menus: ret.append({ 'id':menu.get_id(), 'name':menu.get_name() }) return ret
def getSite(self, params): page_id = int(params[0]) page = Page.get_page(page_id) spaces = page.get_space_names() boxes = page.get_box_info() ret = { 'id':page.get_id(), 'name':page.get_name(), 'description':page.get_description(), 'spaces':spaces, 'boxes':boxes } return ret
def createMenuForSite(self, params): page_id = int(params[0]) page = Page.get_page(page_id) Menu.create_menu(page)