Decorator which wraps whole function into ``with transaction.manager:``.

def transaction_manager(fn):
    """
    Decorator which wraps whole function into ``with transaction.manager:``.
    """
    @wraps(fn)
    def transaction_manager_decorator(*args, **kwargs):
        with transaction.manager:
            return fn(*args, **kwargs)

    return transaction_manager_decorator