:members:
-.. autoclass:: sqlalchemy.orm.interfaces._InspectionAttr
+.. autoclass:: sqlalchemy.orm.interfaces.InspectionAttr
:members:
ASSOCIATION_PROXY = util.symbol('ASSOCIATION_PROXY')
-"""Symbol indicating an :class:`_InspectionAttr` that's
+"""Symbol indicating an :class:`InspectionAttr` that's
of type :class:`.AssociationProxy`.
- Is assigned to the :attr:`._InspectionAttr.extension_type`
+ Is assigned to the :attr:`.InspectionAttr.extension_type`
attibute.
"""
-class AssociationProxy(interfaces._InspectionAttr):
+class AssociationProxy(interfaces.InspectionAttr):
"""A descriptor that presents a read/write view of an object attribute."""
is_attribute = False
from ..orm import attributes, interfaces
HYBRID_METHOD = util.symbol('HYBRID_METHOD')
-"""Symbol indicating an :class:`_InspectionAttr` that's
+"""Symbol indicating an :class:`InspectionAttr` that's
of type :class:`.hybrid_method`.
- Is assigned to the :attr:`._InspectionAttr.extension_type`
+ Is assigned to the :attr:`.InspectionAttr.extension_type`
attibute.
.. seealso::
"""
HYBRID_PROPERTY = util.symbol('HYBRID_PROPERTY')
-"""Symbol indicating an :class:`_InspectionAttr` that's
+"""Symbol indicating an :class:`InspectionAttr` that's
of type :class:`.hybrid_method`.
- Is assigned to the :attr:`._InspectionAttr.extension_type`
+ Is assigned to the :attr:`.InspectionAttr.extension_type`
attibute.
.. seealso::
"""
-class hybrid_method(interfaces._InspectionAttr):
+class hybrid_method(interfaces.InspectionAttr):
"""A decorator which allows definition of a Python object method with both
instance-level and class-level behavior.
return self
-class hybrid_property(interfaces._InspectionAttr):
+class hybrid_property(interfaces.InspectionAttr):
"""A decorator which allows definition of a Python descriptor with both
instance-level and class-level behavior.
@inspection._self_inspects
class QueryableAttribute(interfaces._MappedAttribute,
- interfaces._InspectionAttr,
+ interfaces.InspectionAttr,
interfaces.PropComparator):
"""Base class for :term:`descriptor` objects that intercept
attribute events on behalf of a :class:`.MapperProperty`
NOT_EXTENSION = util.symbol(
'NOT_EXTENSION',
- """Symbol indicating an :class:`_InspectionAttr` that's
+ """Symbol indicating an :class:`InspectionAttr` that's
not part of sqlalchemy.ext.
- Is assigned to the :attr:`._InspectionAttr.extension_type`
+ Is assigned to the :attr:`.InspectionAttr.extension_type`
attibute.
""")
return mapper
-class _InspectionAttr(object):
+class InspectionAttr(object):
"""A base class applied to all ORM objects that can be returned
by the :func:`.inspect` function.
:class:`.QueryableAttribute` which handles attributes events on behalf
of a :class:`.MapperProperty`. But can also be an extension type
such as :class:`.AssociationProxy` or :class:`.hybrid_property`.
- The :attr:`._InspectionAttr.extension_type` will refer to a constant
+ The :attr:`.InspectionAttr.extension_type` will refer to a constant
identifying the specific subtype.
.. seealso::
def _all_sqla_attributes(self, exclude=None):
"""return an iterator of all classbound attributes that are
- implement :class:`._InspectionAttr`.
+ implement :class:`.InspectionAttr`.
This includes :class:`.QueryableAttribute` as well as extension
types such as :class:`.hybrid_property` and
for key in set(supercls.__dict__).difference(exclude):
exclude.add(key)
val = supercls.__dict__[key]
- if isinstance(val, interfaces._InspectionAttr):
+ if isinstance(val, interfaces.InspectionAttr):
yield key, val
def _attr_has_impl(self, key):
from ..sql import operators
from .base import (ONETOMANY, MANYTOONE, MANYTOMANY,
EXT_CONTINUE, EXT_STOP, NOT_EXTENSION)
-from .base import _InspectionAttr, _MappedAttribute
+from .base import InspectionAttr, _MappedAttribute
import collections
# imported later
)
-class MapperProperty(_MappedAttribute, _InspectionAttr):
+class MapperProperty(_MappedAttribute, InspectionAttr):
"""Manage the relationship of a ``Mapper`` to a single class
attribute, as well as that attribute as it appears on individual
instances of the class, including attribute instrumentation,
from . import instrumentation, attributes, exc as orm_exc, loading
from . import properties
from . import util as orm_util
-from .interfaces import MapperProperty, _InspectionAttr, _MappedAttribute
+from .interfaces import MapperProperty, InspectionAttr, _MappedAttribute
from .base import _class_to_mapper, _state_mapper, class_mapper, \
state_str, _INSTRUMENTOR
@inspection._self_inspects
@log.class_logger
-class Mapper(_InspectionAttr):
+class Mapper(InspectionAttr):
"""Define the correlation of class attributes to database table
columns.
@util.memoized_property
def all_orm_descriptors(self):
- """A namespace of all :class:`._InspectionAttr` attributes associated
+ """A namespace of all :class:`.InspectionAttr` attributes associated
with the mapped class.
These attributes are in all cases Python :term:`descriptors`
This namespace includes attributes that are mapped to the class
as well as attributes declared by extension modules.
It includes any Python descriptor type that inherits from
- :class:`._InspectionAttr`. This includes
+ :class:`.InspectionAttr`. This includes
:class:`.QueryableAttribute`, as well as extension types such as
:class:`.hybrid_property`, :class:`.hybrid_method` and
:class:`.AssociationProxy`.
To distinguish between mapped attributes and extension attributes,
- the attribute :attr:`._InspectionAttr.extension_type` will refer
+ the attribute :attr:`.InspectionAttr.extension_type` will refer
to a constant that distinguishes between different extension types.
When dealing with a :class:`.QueryableAttribute`, the
from . import base
-class InstanceState(interfaces._InspectionAttr):
+class InstanceState(interfaces.InspectionAttr):
"""tracks state information at the instance level.
The :class:`.InstanceState` is a key object used by the
from .base import instance_str, state_str, state_class_str, attribute_str, \
state_attribute_str, object_mapper, object_state, _none_set
from .base import class_mapper, _class_to_mapper
-from .base import _InspectionAttr
+from .base import InspectionAttr
from .path_registry import PathRegistry
all_cascades = frozenset(("delete", "delete-orphan", "all", "merge",
id(self), self._aliased_insp._target.__name__)
-class AliasedInsp(_InspectionAttr):
+class AliasedInsp(InspectionAttr):
"""Provide an inspection interface for an
:class:`.AliasedClass` object.