예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    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
예제 #4
0
    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
예제 #5
0
def delete_card(card_id):
	c = CardController()
	return c.delete(card_id)
예제 #6
0
def save_card(card_id):
	c = CardController()
	return c.save(card_id)
예제 #7
0
def prepend_card():
	c = CardController()
	return c.prepend()
예제 #8
0
def append_card():
	c = CardController()
	return c.append()
예제 #9
0
def drag_drop_card():
	c = CardController()
	return c.drag_drop()