Esempio n. 1
0
    def delete(self):
        json_data = request.get_json(force=True)
        data_user_id = json_data['studyID']
        del_by_id = session.query(Study).filter_by(studyID=data_user_id)
        session.delete(del_by_id)
        session.commit()

        return {'message': 'success'}
Esempio n. 2
0
    def delete(self, headers):
        data = self.parser.parse_args()
        data_user_id = data.get('user_id')
        del_by_id = session.query(User).filter_by(user_id=data_user_id).first()
        session.delete(del_by_id)
        session.commit()

        return {'message': 'success'}
Esempio n. 3
0
    def delete(self, headers):
        data = self.parser.parse_args()
        data_template_id = data.get('templateID')
        del_by_id = session.query(Template).filter_by(templateID=data_template_id).first()
        session.delete(del_by_id)
        session.commit()

        return {"statusCode": "1"}
Esempio n. 4
0
 def changed_user(self, _id, new_user):
     old_user_info = User.query.get(_id)
     session.delete(old_user_info)
     new_user = User(id=new_user['id'],
                     username=new_user['username'],
                     password=new_user['password'],
                     email=new_user['email'])  #  , apis=new_user['apis'])
     session.add(new_user)
     session.commit()
     return
Esempio n. 5
0
 def delete_user(self, id):
     user = session.query(User).get(id)
     session.delete(user)
     session.commit()
     return
 def delete_api(self, id):
     api = session.query(Api).get(id)
     session.delete(api)
     session.commit()
     return