def audit_with_request(**kwargs):
    """
    use this decorator to audit an operation with a request as input variable
    """
    def wrap(fn):
        @audit(**kwargs)
        def operation(parent_object, *args, **kw):
            return fn(parent_object.request, *args, **kw)

        @functools.wraps(fn)
        def advice_with_request(the_request, *args, **kw):
            class ParentObject:
                request = the_request

            return operation(ParentObject(), *args, **kw)

        return advice_with_request

    return wrap
use this decorator to audit an operation with a request as input variable