|
|
|
|
|
|
|
|
# route for exporting all users in database |
|
|
# route for exporting all users in database |
|
|
@api.route('/api/users') |
|
|
@api.route('/api/users') |
|
|
@login_required |
|
|
@login_required |
|
|
def get_users(): |
|
|
|
|
|
|
|
|
def get_users_json(): |
|
|
users = User.query.all() |
|
|
users = User.query.all() |
|
|
users_schema = UserSchema(many=True) |
|
|
users_schema = UserSchema(many=True) |
|
|
result = users_schema.dump(users) |
|
|
result = users_schema.dump(users) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# route for exporting all practices in database |
|
|
# route for exporting all practices in database |
|
|
@api.route('/api/practices') |
|
|
@api.route('/api/practices') |
|
|
def get_practices(): |
|
|
|
|
|
|
|
|
def get_practices_json(): |
|
|
resource_type = 'practice' |
|
|
resource_type = 'practice' |
|
|
output = get_resource_json(resource_type) |
|
|
output = get_resource_json(resource_type) |
|
|
return output |
|
|
return output |
|
|
|
|
|
|
|
|
# route for exporting all books in database |
|
|
# route for exporting all books in database |
|
|
@api.route('/api/books') |
|
|
@api.route('/api/books') |
|
|
def get_books(): |
|
|
|
|
|
|
|
|
def get_books_json(): |
|
|
resource_type = 'book' |
|
|
resource_type = 'book' |
|
|
output = get_resource_json(resource_type) |
|
|
output = get_resource_json(resource_type) |
|
|
return output |
|
|
return output |