def put(self, id): controller = CharacterSheetController(request) try: new_character = controller.edit(id) except (DoesNotExist, ValidationError): api.abort(400, "Charcter with id {} does not exist".format(id)) return new_character
def post(self, id, memento_id): controller = CharacterSheetController(request) try: new_memento = controller.memento_backup(id, memento_id) except (DoesNotExist, ValidationError): api.abort(400, "Charcter with id {} does not exist".format(id)) return new_memento
def get(self, id): controller = CharacterSheetController(request) try: character = controller.get_element_detail(id) except (DoesNotExist, ValidationError): api.abort(400, "Character with id {} does not exist".format(id)) return json.loads(character)
def delete(self, id): controller = CharacterSheetController(request) deleted = controller.delete(id) return deleted
def post(self): controller = CharacterSheetController(request) args = controller.new() return args
def get(self): controller = CharacterSheetController(request) query = controller.list() return jsonify(query)
def get_controller(): controller = CharacterSheetController(model=CharacterSheet, request=request) return controller