def delete(self, mode): error_message, status, response = CardController.delete_card(mode) if error_message: return {"error_message": error_message}, status return {"response": "Successfully deleted!"}, status
def get(self, mode): # get_card will return a list error_message, status, response = CardController.get_card(mode) if error_message: return {"error_message": error_message}, status return { "response": list(map(lambda x: x.json_debug() if x else None, response)) }, status
def post(self, mode): data = Card.parser.parse_args() error_message, status, response = CardController.make_card( data['name'], data['accord'], data['image_lnk'], data['vid_lnk'], data['start_time'], data['description']) if error_message: return {"error_message": error_message}, status return {"message": "Success!"}, status
def put(self, mode): data = Card.parser.parse_args() card_id = int(mode) error_message, status, response = CardController.edit_card( card_id, data['name'], data['accord'], data['image_lnk'], data['vid_lnk'], data['start_time'], data['description']) if error_message: return {"error_message": error_message}, status return { "response": "Successfully updated!", "card": response.json() }, status
def delete_card(card_id): c = CardController() return c.delete(card_id)
def save_card(card_id): c = CardController() return c.save(card_id)
def prepend_card(): c = CardController() return c.prepend()
def append_card(): c = CardController() return c.append()
def drag_drop_card(): c = CardController() return c.drag_drop()