def POST(self): pdata = web.input(category_id=None) print pdata.category_id db.delete('Categories', vars=locals(), where="id = $pdata.category_id") items = get_menu_items() tags = db.select('Categories').list() menu_table = render.menu_editor(items, tags) return render_page(menu_table)
def GET(self): if (web.config._session.roleid != 1): raise web.seeother('/') items = get_menu_items() tags = db.select('Categories').list() menu_table = render.menu_editor(items, tags) return render_page(menu_table)
def POST(self): if (web.config._session.roleid != 1): raise web.seeother('/') pdata = web.input(category=None) db.insert('Categories', category = pdata.category) items = get_menu_items() tags = db.select('Categories').list() menu_table = render.menu_editor(items, tags) return render_page(menu_table)