class documentation

class InspectionAttr(object):

Known subclasses: sqlalchemy.orm.attributes.QueryableAttribute, sqlalchemy.orm.base.InspectionAttrInfo, sqlalchemy.orm.interfaces.MapperProperty, sqlalchemy.orm.util.AliasedInsp, sqlalchemy.orm.util.Bundle, sqlalchemy.orm.path_registry.PathToken

View In Hierarchy

A base class applied to all ORM objects that can be returned by the _sa.inspect function.

The attributes defined here allow the usage of simple boolean checks to test basic facts about the object returned.

While the boolean checks here are basically the same as using the Python isinstance() function, the flags here can be used without the need to import all of these classes, and also such that the SQLAlchemy class system can change while leaving the flags here intact for forwards-compatibility.

Class Variable __slots__ Undocumented
Class Variable ​_is​_internal​_proxy True if this object is an internal proxy object.
Class Variable is​_aliased​_class True if this object is an instance of .AliasedClass.
Class Variable is​_attribute True if this object is a Python :term:`descriptor`.
Class Variable is​_bundle True if this object is an instance of .Bundle.
Class Variable is​_clause​_element True if this object is an instance of _expression.ClauseElement.
Class Variable is​_instance True if this object is an instance of .InstanceState.
Class Variable is​_mapper True if this object is an instance of _orm.Mapper.
Class Variable is​_property True if this object is an instance of .MapperProperty.
Class Variable is​_selectable Return True if this object is an instance of _expression.Selectable.
__slots__: tuple =

Undocumented

_is_internal_proxy: bool =

True if this object is an internal proxy object.

New in version 1.2.12.
is_aliased_class: bool =
True if this object is an instance of .AliasedClass.
is_attribute: bool =

True if this object is a Python :term:`descriptor`.

This can refer to one of many types. Usually a .QueryableAttribute which handles attributes events on behalf of a .MapperProperty. But can also be an extension type such as .AssociationProxy or .hybrid_property. The .InspectionAttr.extension_type will refer to a constant identifying the specific subtype.

See Also

_orm.Mapper.all_orm_descriptors

is_bundle: bool =
True if this object is an instance of .Bundle.
is_clause_element: bool =
True if this object is an instance of _expression.ClauseElement.
is_instance: bool =
True if this object is an instance of .InstanceState.
is_mapper: bool =
True if this object is an instance of _orm.Mapper.
is_property: bool =
True if this object is an instance of .MapperProperty.
is_selectable: bool =
Return True if this object is an instance of _expression.Selectable.