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
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 . |
bool
=
sqlalchemy.orm.util.AliasedInsp
, sqlalchemy.orm.util.Bundle
.AliasedClass
.bool
=
sqlalchemy.ext.associationproxy.AssociationProxy
, sqlalchemy.ext.hybrid.hybrid_method
, sqlalchemy.ext.hybrid.hybrid_property
, sqlalchemy.orm.attributes.QueryableAttribute
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
bool
=
sqlalchemy.orm.util.Bundle
.Bundle
.bool
=
sqlalchemy.orm.util.Bundle
_expression.ClauseElement
.bool
=
sqlalchemy.orm.state.InstanceState
.InstanceState
.bool
=
sqlalchemy.orm.util.Bundle
_orm.Mapper
.bool
=
sqlalchemy.orm.interfaces.MapperProperty
.MapperProperty
.