Exemplo n.º 1
0
    def get(self,uid):

        user = User.query.filter_by(uid=uid).first()
        schema = UserSchema()
        if user is not None:
            return Response(schema.dumps(user,indent=1).data,mimetype='application/json'),201
        return jsonify({"get":"fail"})
Exemplo n.º 2
0
 def get(self):
     users = User.query.filter(User.admin == 1).all()
     if users == []:
         return jsonify({'get':'fail'})
     schema = UserSchema(many = True)
     return Response(schema.dumps(users,indent=1).data,mimetype='application/json')