Example #1
0
    def get(self, action):
        if action == 'remove':
            try:
                _id = ObjectId(request.args.get('_id'))
            except InvalidId:
                return {'error': 'You must specify an ID'}, 400

            result = Model.remove_by_id(_id)
            return result

        if action == 'add':
            # TODO
            pass
Example #2
0
    def get(self, action):
        if action == 'remove':
            try:
                _id = ObjectId(request.args.get('_id'))
            except InvalidId:
                return {'error': 'You must specify an ID'}, 400

            result = Model.remove_by_id(_id)
            return result

        if action == 'add':
            # TODO
            pass
Example #3
0
File: api.py Project: CYJ/malcom
def delete(id):
	result = Model.remove_by_id(id)
	return (dumps(result), 200, {'Content-Type': 'application/json'})
Example #4
0
File: api.py Project: darron/malcom
def delete(id):
    result = Model.remove_by_id(id)
    return (dumps(result), 200, {'Content-Type': 'application/json'})