class documentation

class ClassManager(HasMemoized, dict):

Known subclasses: sqlalchemy.ext.instrumentation._ClassInstrumentationAdapter

View In Hierarchy

Tracks state information at the class level.
Method __bool__ All ClassManagers are non-zero regardless of attribute state.
Method __eq__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method __repr__ Undocumented
Method ​_all​_key​_set Undocumented
Method ​_all​_sqla​_attributes return an iterator of all classbound attributes that are implement .InspectionAttr.
Method ​_attr​_has​_impl Return True if the given attribute is fully initialized.
Method ​_collection​_impl​_keys Undocumented
Method ​_finalize Undocumented
Method ​_get​_class​_attr​_mro return an attribute on the class without tripping it.
Method ​_instrument​_init Undocumented
Method ​_loader​_impls Undocumented
Method ​_new​_state​_if​_none Install a default InstanceState if none is present.
Method ​_scalar​_loader​_impls Undocumented
Method ​_serialize Undocumented
Method ​_subclass​_manager Create a new ClassManager for a subclass of this ClassManager's class.
Method ​_update​_state Undocumented
Method deferred​_scalar​_loader.setter Undocumented
Method dict​_getter Undocumented
Method get​_impl Undocumented
Method has​_parent TODO
Method has​_state Undocumented
Method initialize​_collection Undocumented
Method install​_descriptor Undocumented
Method install​_member Undocumented
Method instrument​_attribute Undocumented
Method instrument​_collection​_class Undocumented
Method is​_instrumented Undocumented
Method manage Mark this instance as the manager for its class.
Method manager​_getter Undocumented
Method new​_instance Undocumented
Method post​_configure​_attribute Undocumented
Method setup​_instance Undocumented
Method state​_getter Return a (instance) -> InstanceState callable.
Method subclass​_managers Undocumented
Method teardown​_instance Undocumented
Method uninstall​_descriptor Undocumented
Method uninstall​_member Undocumented
Method uninstrument​_attribute Undocumented
Method unregister remove all instrumentation established by this ClassManager.
Class Variable ​_state​_setter Undocumented
Class Variable factory Undocumented
Class Variable registry Undocumented
Instance Variable ​_bases Undocumented
Instance Variable ​_finalized Undocumented
Instance Variable class​_ Undocumented
Instance Variable declarative​_scan Undocumented
Instance Variable dispatch Undocumented
Instance Variable expired​_attribute​_loader previously known as deferred_scalar_loader
Instance Variable info Undocumented
Instance Variable init​_method Undocumented
Instance Variable local​_attrs Undocumented
Instance Variable mapper Undocumented
Instance Variable new​_init Undocumented
Instance Variable original​_init Undocumented
Instance Variable originals Undocumented
Property ​_state​_constructor Undocumented
Property attributes Undocumented
Property deferred​_scalar​_loader Undocumented
Property is​_mapped Undocumented
def __bool__(self):
All ClassManagers are non-zero regardless of attribute state.
def __eq__(self, other):

Undocumented

def __hash__(self):

Undocumented

def __init__(self, class_):
def __repr__(self):

Undocumented

@HasMemoized.memoized_attribute
def _all_key_set(self):

Undocumented

def _all_sqla_attributes(self, exclude=None):

return an iterator of all classbound attributes that are implement .InspectionAttr.

This includes .QueryableAttribute as well as extension types such as .hybrid_property and .AssociationProxy.

def _attr_has_impl(self, key):

Return True if the given attribute is fully initialized.

i.e. has an impl.

@HasMemoized.memoized_attribute
def _collection_impl_keys(self):

Undocumented

def _finalize(self):

Undocumented

def _get_class_attr_mro(self, key, default=None):
return an attribute on the class without tripping it.
def _instrument_init(self):

Undocumented

@HasMemoized.memoized_attribute
def _loader_impls(self):

Undocumented

def _new_state_if_none(self, instance):

Install a default InstanceState if none is present.

A private convenience method used by the __init__ decorator.

@HasMemoized.memoized_attribute
def _scalar_loader_impls(self):

Undocumented

def _serialize(self, state, state_dict):

Undocumented

def _subclass_manager(self, cls):

Create a new ClassManager for a subclass of this ClassManager's class.

This is called automatically when attributes are instrumented so that the attributes can be propagated to subclasses against their own class-local manager, without the need for mappers etc. to have already pre-configured managers for the full class hierarchy. Mappers can post-configure the auto-generated ClassManager when needed.

def _update_state(self, finalize=False, mapper=None, registry=None, declarative_scan=None, expired_attribute_loader=None, init_method=None):

Undocumented

@deferred_scalar_loader.setter
@util.deprecated('1.4', message='The ClassManager.deferred_scalar_loader attribute is now named expired_attribute_loader')
def deferred_scalar_loader(self, obj):

Undocumented

@util.hybridmethod
def dict_getter(self):
def get_impl(self, key):

Undocumented

def has_parent(self, state, key, optimistic=False):
TODO
def has_state(self, instance):
def initialize_collection(self, key, state, factory):
def install_descriptor(self, key, inst):
def install_member(self, key, implementation):
def instrument_attribute(self, key, inst, propagated=False):
def instrument_collection_class(self, key, collection_class):
def is_instrumented(self, key, search=False):

Undocumented

def manage(self):
Mark this instance as the manager for its class.
@util.hybridmethod
def manager_getter(self):
def new_instance(self, state=None):
def post_configure_attribute(self, key):
def setup_instance(self, instance, state=None):
@util.hybridmethod
def state_getter(self):

Return a (instance) -> InstanceState callable.

"state getter" callables should raise either KeyError or AttributeError if no InstanceState could be found for the instance.

def subclass_managers(self, recursive):

Undocumented

def teardown_instance(self, instance):
def uninstall_descriptor(self, key):
def uninstall_member(self, key):
def uninstrument_attribute(self, key, propagated=False):

Undocumented

def unregister(self):
remove all instrumentation established by this ClassManager.
_state_setter =

Undocumented

factory =

Undocumented

registry =

Undocumented

_bases =

Undocumented

_finalized: bool =

Undocumented

class_ =

Undocumented

declarative_scan =

Undocumented

dispatch =

Undocumented

expired_attribute_loader =
previously known as deferred_scalar_loader
info: dict =

Undocumented

init_method =

Undocumented

local_attrs: dict =

Undocumented

Undocumented

new_init =

Undocumented

original_init =

Undocumented

originals: dict =

Undocumented

@util.memoized_property
_state_constructor =

Undocumented

@property
attributes =

Undocumented

@property
@util.deprecated('1.4', message='The ClassManager.deferred_scalar_loader attribute is now named expired_attribute_loader')
deferred_scalar_loader =

Undocumented

@property
is_mapped =

Undocumented