def remove_book(self, group_id, book_id): group = Group.query_by_id(group_id) book = Book.query_by_id(book_id) group.remove_book(book) return "OK"
def title(self, group_id): group = Group.query_by_id(group_id) return group.title
def leave(self, group_id): user = cherrypy.request.user group = Group.query_by_id(group_id) with session_scope() as s: user.leave_group(s, group)