예제 #1
0
class UserListApi(ResourceList):
    def after_get(self, result):
        for item in result['data']:
            del item['attributes']['password']
        return result

    decorators = (api.has_permission(access_level='admin'),)
    schema = UserSchema
    data_layer = {'session': db.session,
                  'model': User,
                  'methods': {'after_get': after_get}}
예제 #2
0
class PersonListApi(ResourceList):
    decorators = (api.has_permission(access_level='user'),)
    schema = PersonSchema
    data_layer = {'session': db.session, 'model': Person}
예제 #3
0
class PersonDetailApi(ResourceDetail):
    decorators = (api.has_permission(access_level='user'),)
    schema = PersonSchema
예제 #4
0
class UserDetailApi(ResourceDetail):
    decorators = (api.has_permission(access_level='admin'),)
    schema = UserSchema
    data_layer = {'session': db.session, 'model': User}
예제 #5
0
class SwipeDetailApi(ResourceDetail):
    decorators = (api.has_permission(access_level='user'), )
    schema = SwipeSchema