MCPcopy
hub / github.com/tortoise/tortoise-orm / __enter__

Method __enter__

tortoise/context.py:487–495  ·  view source on GitHub ↗

Enter the context manager and set this context as current. Returns: This context instance.

(self)

Source from the content-addressed store, hash-verified

485 _global_context = None
486
487 def __enter__(self) -> TortoiseContext:
488 """
489 Enter the context manager and set this context as current.
490
491 Returns:
492 This context instance.
493 """
494 self._token = _current_context.set(self)
495 return self
496
497 def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:
498 """

Callers 6

__aenter__Method · 0.95
init_appMethod · 0.95
initMethod · 0.95
_reset_tortoiseFunction · 0.95
_reset_tortoiseFunction · 0.95
_reset_tortoiseFunction · 0.95

Calls 1

setMethod · 0.80

Tested by 3

_reset_tortoiseFunction · 0.76
_reset_tortoiseFunction · 0.76
_reset_tortoiseFunction · 0.76