示例#1
0
 def post(self):
     args = UserParser.parse_args()
     session = db_session.create_session()
     user = User()
     user.surname = args["surname"]
     user.name = args["name"]
     user.age = args["age"]
     user.position = args["position"]
     user.speciality = args["speciality"]
     user.address = args["address"]
     user.email = args["email"]
     session.add(user)
     session.commit()
     return jsonify({'success': 'OK'})
    def post(self):
        args = parser.parse_args()
        session = DataBase.create_session()
        user = User()
        user.name = args["name"]
        user.surname = args["surname"]
        user.email = args["email"]
        user.hashed_password = args["hashed_password"]
        user.salt = args["salt"]
        user.confirmed = args['confirmed']
        user.money = args['money']
        session.add(user)
        session.commit()

        return jsonify({'success': 'OK'})