def transaction_before_request():
 if view_has_annotation(NO_AUTO_TRANSACTION_ATTR):
  return None
 ctx = _request_ctx_stack.top
 atomic = transaction.atomic()
 atomic.__enter__()
 ctx.current_atomic = atomic

def transaction_before_request ( ) : if view_has_annotation ( NO_AUTO_TRANSACTION_ATTR ) : return None ctx = _request_ctx_stack . top atomic = transaction . atomic ( ) atomic . __enter__ ( ) ctx . current_atomic = atomic
setup transaction before handling the request .