MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / initialize_collection

Method initialize_collection

lib/sqlalchemy/orm/instrumentation.py:466–476  ·  view source on GitHub ↗
(
        self,
        key: str,
        state: InstanceState[_O],
        factory: _CollectionFactoryType,
    )

Source from the content-addressed store, hash-verified

464 return collections._prepare_instrumentation(collection_class)
465
466 def initialize_collection(
467 self,
468 key: str,
469 state: InstanceState[_O],
470 factory: _CollectionFactoryType,
471 ) -> Tuple[collections.CollectionAdapter, _AdaptedCollectionProtocol]:
472 user_data = factory()
473 impl = self.get_impl(key)
474 assert _is_collection_attribute_impl(impl)
475 adapter = collections.CollectionAdapter(impl, state, user_data)
476 return adapter, user_data
477
478 def is_instrumented(self, key: str, search: bool = False) -> bool:
479 if search:

Callers 1

Calls 2

get_implMethod · 0.95

Tested by

no test coverage detected