def js_items(req): pager = Pager(limit=-1) items = [] for item in MenuItem.list(req, pager): items.append(item.__dict__) req.content_type = "application/json" return json.dumps({"items": items})
def admin_menu(req): check_login(req) check_right(req, module_right) pager = Pager(limit=-1) items = MenuItem.list(req, pager) return generate_page( req, "admin/page_menu.html", token=do_create_token(req, "/admin/menu"), pager=pager, items=items )