module documentation

Constants and rudimental functions used throughout the ORM.
Class ​Inspection​Attr A base class applied to all ORM objects that can be returned by the _sa.inspect function.
Class ​Inspection​Attr​Info Adds the .info attribute to .InspectionAttr.
Constant ATTR​_EMPTY Undocumented
Constant ATTR​_WAS​_SET Undocumented
Constant CALLABLES​_OK Undocumented
Constant DEFAULT​_MANAGER​_ATTR Undocumented
Constant DEFAULT​_STATE​_ATTR Undocumented
Constant DEFERRED​_HISTORY​_LOAD Undocumented
Constant INIT​_OK Undocumented
Constant LOAD​_AGAINST​_COMMITTED Undocumented
Constant NO​_AUTOFLUSH Undocumented
Constant NO​_CHANGE Undocumented
Constant NO​_RAISE Undocumented
Constant NO​_VALUE Undocumented
Constant NON​_PERSISTENT​_OK Undocumented
Constant PASSIVE​_CLASS​_MISMATCH Undocumented
Constant PASSIVE​_NO​_FETCH Undocumented
Constant PASSIVE​_NO​_FETCH​_RELATED Undocumented
Constant PASSIVE​_NO​_INITIALIZE Undocumented
Constant PASSIVE​_NO​_RESULT Undocumented
Constant PASSIVE​_OFF Undocumented
Constant PASSIVE​_ONLY​_PERSISTENT Undocumented
Constant PASSIVE​_RETURN​_NO​_VALUE Undocumented
Constant RELATED​_OBJECT​_OK Undocumented
Constant SQL​_OK Undocumented
Variable instance​_dict Undocumented
Variable instance​_state Undocumented
Class _​Mapped​Attribute Mixin for attributes which should be replaced by mapper-assigned attributes.
Function ​_assertions Undocumented
Function ​_class​_to​_mapper Undocumented
Function ​_entity​_descriptor Return a class attribute given an entity and string name.
Function ​_inspect​_mapped​_class Undocumented
Function ​_inspect​_mapped​_object Undocumented
Function ​_is​_aliased​_class Undocumented
Function ​_is​_mapped​_class Return True if the given object is a mapped class, _orm.Mapper, or .AliasedClass.
Function ​_mapper​_or​_none Return the _orm.Mapper for the given class or None if the class is not mapped.
Function ​_orm​_columns Undocumented
Function attribute​_str Undocumented
Function class​_mapper Given a class, return the primary _orm.Mapper associated with the key.
Function instance​_str Return a string describing an instance.
Function manager​_of​_class Undocumented
Function object​_mapper Given an object, return the primary Mapper associated with the object instance.
Function object​_state Given an object, return the .InstanceState associated with the object.
Function state​_attribute​_str Undocumented
Function state​_class​_str Return a string describing an instance's class via its InstanceState.
Function state​_str Return a string describing an instance via its InstanceState.
Constant ​_DEFER​_FOR​_STATE Undocumented
Constant ​_RAISE​_FOR​_STATE Undocumented
Constant ​_SET​_DEFERRED​_EXPIRED Undocumented
Variable ​_never​_set Undocumented
Variable ​_none​_set Undocumented
Variable ​_state​_mapper Undocumented
ATTR_EMPTY =

Undocumented

Value
util.symbol('ATTR_EMPTY',
            'Symbol used internally to indicate an attribute had no callable.')
ATTR_WAS_SET =

Undocumented

Value
util.symbol('ATTR_WAS_SET',
            '''Symbol returned by a loader callable to indicate the
    retrieved value, or values, were assigned to their attributes
    on the target object.
    ''')
CALLABLES_OK =

Undocumented

Value
util.symbol('CALLABLES_OK',
            '''Loader callables can be fired off if a value
    is not present.
    ''',
            canonical=1)
DEFAULT_MANAGER_ATTR: str =

Undocumented

Value
'_sa_class_manager'
DEFAULT_STATE_ATTR: str =

Undocumented

Value
'_sa_instance_state'
DEFERRED_HISTORY_LOAD =

Undocumented

Value
util.symbol('DEFERRED_HISTORY_LOAD',
            'indicates special load of the previous value of an attribute',
            canonical=256)
INIT_OK =

Undocumented

Value
util.symbol('INIT_OK',
            '''Attributes should be initialized with a blank
    value (None or an empty collection) upon get, if no other
    value can be obtained.
    ''',
            canonical=8)
LOAD_AGAINST_COMMITTED =

Undocumented

Value
util.symbol('LOAD_AGAINST_COMMITTED',
            '''Callables should use committed values as primary/foreign keys dur
ing a
    load.
    ''',
            canonical=32)
NO_AUTOFLUSH =

Undocumented

Value
util.symbol('NO_AUTOFLUSH', 'Loader callables should disable autoflush.',
            canonical=64)
NO_CHANGE =

Undocumented

Value
util.symbol('NO_CHANGE',
            '''No callables or SQL should be emitted on attribute access
    and no state should change
    ''',
            canonical=0)
NO_RAISE =

Undocumented

Value
util.symbol('NO_RAISE', 'Loader callables should not raise any assertions',
            canonical=128)
NO_VALUE =

Undocumented

Value
util.symbol('NO_VALUE',
            '''Symbol which may be placed as the \'previous\' value of an attrib
ute,
    indicating no value was loaded for an attribute when it was modified,
    and flags indicated we were not to load it.
    ''')
NON_PERSISTENT_OK =

Undocumented

Value
util.symbol('NON_PERSISTENT_OK',
            'Callables can be emitted if the parent is not persistent.',
            canonical=16)
PASSIVE_CLASS_MISMATCH =

Undocumented

Value
util.symbol('PASSIVE_CLASS_MISMATCH',
            '''Symbol indicating that an object is locally present for a given
    primary key identity but it is not of the requested class.  The
    return value is therefore None and no SQL should be emitted.''')
PASSIVE_NO_FETCH =

Undocumented

Value
util.symbol('PASSIVE_NO_FETCH', 'PASSIVE_OFF ^ SQL_OK',
            canonical=PASSIVE_OFF^SQL_OK)
PASSIVE_NO_FETCH_RELATED =

Undocumented

Value
util.symbol('PASSIVE_NO_FETCH_RELATED', 'PASSIVE_OFF ^ RELATED_OBJECT_OK',
            canonical=PASSIVE_OFF^RELATED_OBJECT_OK)
PASSIVE_NO_INITIALIZE =

Undocumented

Value
util.symbol('PASSIVE_NO_INITIALIZE', 'PASSIVE_RETURN_NO_VALUE ^ CALLABLES_OK',
            canonical=PASSIVE_RETURN_NO_VALUE^CALLABLES_OK)
PASSIVE_NO_RESULT =

Undocumented

Value
util.symbol('PASSIVE_NO_RESULT',
            '''Symbol returned by a loader callable or other attribute/history
    retrieval operation when a value could not be determined, based
    on loader callable flags.
    ''')
PASSIVE_OFF =

Undocumented

Value
util.symbol('PASSIVE_OFF', 'Callables can be emitted in all cases.',
            canonical=(((RELATED_OBJECT_OK|NON_PERSISTENT_OK)|INIT_OK)|CALLABLES_OK)|SQL_OK)
PASSIVE_ONLY_PERSISTENT =

Undocumented

Value
util.symbol('PASSIVE_ONLY_PERSISTENT', 'PASSIVE_OFF ^ NON_PERSISTENT_OK',
            canonical=PASSIVE_OFF^NON_PERSISTENT_OK)
PASSIVE_RETURN_NO_VALUE =

Undocumented

Value
util.symbol('PASSIVE_RETURN_NO_VALUE', 'PASSIVE_OFF ^ INIT_OK',
            canonical=PASSIVE_OFF^INIT_OK)
RELATED_OBJECT_OK =

Undocumented

Value
util.symbol('RELATED_OBJECT_OK',
            '''Callables can use SQL to load related objects as well
    as scalar value attributes.
    ''',
            canonical=4)
SQL_OK =

Undocumented

Value
util.symbol('SQL_OK',
            'Loader callables can emit SQL at least on scalar value attributes.'
,
            canonical=2)
instance_dict =

Undocumented

instance_state =

Undocumented

def _assertions(*assertions):

Undocumented

def _class_to_mapper(class_or_mapper):

Undocumented

def _entity_descriptor(entity, key):

Return a class attribute given an entity and string name.

May return .InstrumentedAttribute or user-defined attribute.

@inspection._inspects(type)
def _inspect_mapped_class(class_, configure=False):

Undocumented

@inspection._inspects(object)
def _inspect_mapped_object(instance):

Undocumented

def _is_aliased_class(entity):

Undocumented

def _is_mapped_class(entity):
Return True if the given object is a mapped class, _orm.Mapper, or .AliasedClass.
def _mapper_or_none(entity):
Return the _orm.Mapper for the given class or None if the class is not mapped.
def _orm_columns(entity):

Undocumented

def attribute_str(instance, attribute):

Undocumented

def class_mapper(class_, configure=True):

Given a class, return the primary _orm.Mapper associated with the key.

Raises .UnmappedClassError if no mapping is configured on the given class, or .ArgumentError if a non-class object is passed.

Equivalent functionality is available via the _sa.inspect function as:

inspect(some_mapped_class)

Using the inspection system will raise sqlalchemy.exc.NoInspectionAvailable if the class is not mapped.

def instance_str(instance):
Return a string describing an instance.
def manager_of_class(cls):

Undocumented

def object_mapper(instance):

Given an object, return the primary Mapper associated with the object instance.

Raises sqlalchemy.orm.exc.UnmappedInstanceError if no mapping is configured.

This function is available via the inspection system as:

inspect(instance).mapper

Using the inspection system will raise sqlalchemy.exc.NoInspectionAvailable if the instance is not part of a mapping.

def object_state(instance):

Given an object, return the .InstanceState associated with the object.

Raises sqlalchemy.orm.exc.UnmappedInstanceError if no mapping is configured.

Equivalent functionality is available via the _sa.inspect function as:

inspect(instance)

Using the inspection system will raise sqlalchemy.exc.NoInspectionAvailable if the instance is not part of a mapping.

def state_attribute_str(state, attribute):

Undocumented

def state_class_str(state):
Return a string describing an instance's class via its InstanceState.
def state_str(state):
Return a string describing an instance via its InstanceState.
_DEFER_FOR_STATE =

Undocumented

Value
util.symbol('DEFER_FOR_STATE')
_RAISE_FOR_STATE =

Undocumented

Value
util.symbol('RAISE_FOR_STATE')
_SET_DEFERRED_EXPIRED =

Undocumented

Value
util.symbol('SET_DEFERRED_EXPIRED')
_never_set =

Undocumented

_none_set =

Undocumented

_state_mapper =

Undocumented