Beispiel #1
0
def pre_get_callback(resource, request, lookup):
    """ Callback called before a GET request, we can alter the lookup. """
    klass = resource_get_model(resource)
    klass().on_pre_get(request, lookup)
Beispiel #2
0
def pre_patch_callback(resource, request, query):
    """ Callback called just before the normal processing behavior of a PATCH
    request.
    """
    klass = resource_get_model(resource)
    klass().on_pre_patch(request, query)
Beispiel #3
0
def post_post_callback(resource, request, response):
    """ Callback called just after a POST request ended. """
    # app.logger.info('### post_post({}) request: {}, response: {}'
    #                 .format(resource, request, response))
    klass = resource_get_model(resource)
    klass().on_post_post(request, response)
Beispiel #4
0
def pre_post_callback(resource, request):
    """ Callback called just before the normal processing behavior of a POST
    request.
    """
    klass = resource_get_model(resource)
    klass().on_pre_post(request)
Beispiel #5
0
def updated_callback(resource, item, original):
    """ Callback called just after updating a resource in mongo. """
    # app.logger.debug('### updated_callback({}) {}'.format(resource, items))
    klass = resource_get_model(resource)
    klass().on_updated(item, original)
Beispiel #6
0
def inserted_callback(resource, items):
    """ Callback called just after inserting a resource in mongo. """
    # app.logger.debug('### inserted_callback({}) {}'.format(resource, items))
    klass = resource_get_model(resource)
    for item in items:
        klass().on_inserted(item)