예제 #1
0
 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)
예제 #2
0
    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)
예제 #3
0
 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)