Esempio n. 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
Esempio n. 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
Esempio n. 3
0
File: api.py Progetto: CYJ/malcom
def delete(id):
	result = Model.remove_by_id(id)
	return (dumps(result), 200, {'Content-Type': 'application/json'})
Esempio n. 4
0
File: api.py Progetto: darron/malcom
def delete(id):
    result = Model.remove_by_id(id)
    return (dumps(result), 200, {'Content-Type': 'application/json'})