def GET(self, message_id): model.MessageBoard().ddel(message_id) user_id = model.User().current_id() manager_id = model.Manager().current_id() if user_id: raise web.seeother('/user/%d' % user_id) else: if manager_id: raise web.seeother('/manager/%d' % manager_id) else: raise web.notfound()
def GET(self, user_id): user_id = int(user_id) status = model.User().status(user_id) if status['username']: if user_id == model.User().current_id(): my_messages = model.MessageBoard().show(user_id) my_comments = model.Comment().show_ones(user_id) return titled_render(status['username']).master_profile( status['username'], status['picture'], status['description'], status['email'], my_messages, my_comments) else: return titled_render(status['username']).user_profile( status['username'], status['picture'], status['description']) else: raise web.notfound()
def GET(self): page_bulletins = model.BulletinBoard().show_all() page_messages = model.MessageBoard().show_all() page_foods = model.Foods().list() return titled_render('admin').admin(page_bulletins, page_foods, page_messages)
def GET(self): i = web.input(page='1') page = int(i.page) page_posts, page_count = model.MessageBoard().list(page) return titled_render('').MessageBoard(page_posts, page_count, page)
def POST(self): i = web.input(content='') post_id = model.MessageBoard().new(i.content, model.User().current_id()) raise web.seeother('/MessageBoard')