class ColumnProperty(_MapsColumns[
Known subclasses: sqlalchemy.orm.properties.MappedSQLExpression
Describes an object attribute that corresponds to a table column or other column expression. Public constructor is the :func:`_orm.column_property` function.
Class |
|
Produce boolean, comparison, and other operators for :class:`.ColumnProperty` attributes. |
Method | __clause |
Allow the ColumnProperty to work in expression before it is turned into an instrumented attribute. |
Method | __init__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | copy |
Undocumented |
Method | declarative |
Perform class-specific initializaton at early declarative scanning time. |
Method | do |
Perform subclass-specific initialization post-mapper-creation steps. |
Method | instrument |
Hook called by the Mapper to the property to initiate instrumentation of the class attribute managed by this MapperProperty. |
Method | merge |
Merge the attribute represented by this ``MapperProperty`` from source to destination object. |
Class Variable | __slots__ |
Undocumented |
Class Variable | inherit |
:meta private: |
Instance Variable | active |
Undocumented |
Instance Variable | columns |
Undocumented |
Instance Variable | comparator |
Undocumented |
Instance Variable | deferred |
Undocumented |
Instance Variable | doc |
optional documentation string |
Instance Variable | expire |
Undocumented |
Instance Variable | group |
Undocumented |
Instance Variable | instrument |
Undocumented |
Instance Variable | raiseload |
Undocumented |
Instance Variable | strategy |
Undocumented |
Property | columns |
A list of Column objects that should be declaratively added to the new Table object. |
Property | expression |
Return the primary column or expression for this ColumnProperty. |
Property | mapper |
return a MapperProperty to be assigned to the declarative mapping |
Method | _memoized |
Undocumented |
Method | _memoized |
Undocumented |
Method | _memoized |
Undocumented |
Class Variable | _is |
Undocumented |
Class Variable | _links |
True if this MapperProperty refers to a mapped entity. |
Class Variable | _mapped |
Undocumented |
Inherited from StrategizedProperty
(via _MapsColumns
):
Class Method | strategy |
Undocumented |
Method | create |
Produce row processing functions and append to the given set of populators lists. |
Method | post |
Perform instrumentation adjustments that need to occur after init() has completed. |
Method | setup |
Called by Query for the purposes of constructing a SQL statement. |
Class Variable | strategy |
Undocumented |
Instance Variable | strategy |
Undocumented |
Class Method | _strategy |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _memoized |
Undocumented |
Method | _memoized |
Undocumented |
Class Variable | _all |
Undocumented |
Instance Variable | _strategies |
Undocumented |
Inherited from MapperProperty
(via _MapsColumns
, StrategizedProperty
):
Method | __repr__ |
Undocumented |
Method | cascade |
Iterate through instances related to the given instance for a particular 'cascade', starting with this MapperProperty. |
Method | init |
Called after all mappers are created to assemble relationships between mappers and perform other post-mapper-creation initialization steps. |
Method | set |
Set the parent mapper that references this MapperProperty. |
Class Variable | cascade |
Undocumented |
Class Variable | comparator |
The :class:`_orm.PropComparator` instance that implements SQL expression construction on behalf of this mapped attribute. |
Class Variable | info |
Info dictionary associated with the object, allowing user-defined data to be associated with this :class:`.InspectionAttr`. |
Class Variable | is |
Part of the InspectionAttr interface; states this object is a mapper property. |
Class Variable | key |
name of class attribute |
Instance Variable | parent |
the :class:`.Mapper` managing this property. |
Property | class |
Return the class-bound descriptor corresponding to this :class:`.MapperProperty`. |
Method | _memoized |
Info dictionary associated with the object, allowing user-defined data to be associated with this :class:`.InspectionAttr`. |
Class Variable | _cache |
Undocumented |
Class Variable | _is |
Undocumented |
Instance Variable | _attribute |
behavioral options for ORM-enabled Python attributes |
Instance Variable | _configure |
Undocumented |
Instance Variable | _configure |
Undocumented |
Instance Variable | _has |
Undocumented |
Inherited from HasCacheKey
(via _MapsColumns
, StrategizedProperty
, MapperProperty
):
Class Method | _generate |
generate cache key dispatcher for a new class. |
Class Method | _generate |
Undocumented |
Method | _gen |
return an optional cache key. |
Method | _generate |
return a cache key. |
Class Variable | _generated |
Undocumented |
Class Variable | _hierarchy |
private attribute which may be set to False to prevent the inherit_cache warning from being emitted for a hierarchy of subclasses. |
Class Variable | _is |
Undocumented |
Inherited from TypingOnly
(via _MapsColumns
, StrategizedProperty
, MapperProperty
, HasCacheKey
, _DCAttributeOptions
, _MappedAttribute
):
Method | __init |
Undocumented |
Inherited from InspectionAttr
(via _MapsColumns
, StrategizedProperty
, MapperProperty
, HasCacheKey
, _DCAttributeOptions
, _MappedAttribute
, TypingOnly
, InspectionAttrInfo
):
Class Variable | is |
True if this object is an instance of :class:`.AliasedClass`. |
Class Variable | is |
True if this object is a Python :term:`descriptor`. |
Class Variable | is |
True if this object is an instance of :class:`.Bundle`. |
Class Variable | is |
True if this object is an instance of :class:`_expression.ClauseElement`. |
Class Variable | is |
True if this object is an instance of :class:`.InstanceState`. |
Class Variable | is |
True if this object is an instance of :class:`_orm.Mapper`. |
Class Variable | is |
Return True if this object is an instance of :class:`_expression.Selectable`. |
Class Variable | _is |
True if this object is an internal proxy object. |
Inherited from MemoizedSlots
(via _MapsColumns
, StrategizedProperty
, MapperProperty
, HasCacheKey
, _DCAttributeOptions
, _MappedAttribute
, TypingOnly
, InspectionAttrInfo
, InspectionAttr
):
Method | __getattr__ |
Undocumented |
Method | _fallback |
Undocumented |
Inherited from _IntrospectsAnnotations
(via _MapsColumns
, StrategizedProperty
, MapperProperty
, HasCacheKey
, _DCAttributeOptions
, _MappedAttribute
, TypingOnly
, InspectionAttrInfo
, InspectionAttr
, MemoizedSlots
):
Method | found |
return a copy of this object to use in declarative when the object is found inside of an Annotated object. |
Method | _raise |
Undocumented |
Inherited from Identified
(via _MapsColumns
, StrategizedProperty
, MapperProperty
, HasCacheKey
, _DCAttributeOptions
, _MappedAttribute
, TypingOnly
, InspectionAttrInfo
, InspectionAttr
, MemoizedSlots
, _IntrospectsAnnotations
):
Class Variable | logger |
Undocumented |
Class Variable | logging |
Undocumented |
Method | _should |
Undocumented |
Method | _should |
Undocumented |
Class Variable | _echo |
Undocumented |
_ORMColumnExprArgument[ _T]
, *additional_columns: _ORMColumnExprArgument[ Any]
, attribute_options: Optional[ _AttributeOptions]
= None, group: Optional[ str]
= None, deferred: bool
= False, raiseload: bool
= False, comparator_factory: Optional[ Type[ PropComparator[ _T]]]
= None, active_history: bool
= False, expire_on_flush: bool
= True, info: Optional[ _InfoType]
= None, doc: Optional[ str]
= None, _instrument: bool
= True):
(source)
¶
Undocumented
_ClassScanMapperConfig
, registry: _RegistryType
, cls: Type[ Any]
, originating_module: Optional[ str]
, key: str
, mapped_container: Optional[ Type[ Mapped[ Any]]]
, annotation: Optional[ _AnnotationScanType]
, extracted_mapped_annotation: Optional[ _AnnotationScanType]
, is_dataclass_field: bool
):
(source)
¶
Perform class-specific initializaton at early declarative scanning time. .. versionadded:: 2.0
Perform subclass-specific initialization post-mapper-creation steps. This is a template method called by the ``MapperProperty`` object's init() method.
Hook called by the Mapper to the property to initiate instrumentation of the class attribute managed by this MapperProperty. The MapperProperty here will typically call out to the attributes module to set up an InstrumentedAttribute. This step is the first of two steps to set up an InstrumentedAttribute, and is called early in the mapper setup process. The second step is typically the init_class_attribute step, called from StrategizedProperty via the post_instrument_class() hook. This step assigns additional state to the InstrumentedAttribute (specifically the "impl") which has been determined after the MapperProperty has determined what kind of persistence management it needs to do (e.g. scalar, object, collection, etc).
Session
, source_state: InstanceState[ Any]
, source_dict: _InstanceDict
, dest_state: InstanceState[ Any]
, dest_dict: _InstanceDict
, load: bool
, _recursive: Dict[ Any, object]
, _resolve_conflict_map: Dict[ _IdentityKeyType[ Any], object]
):
(source)
¶
Merge the attribute represented by this ``MapperProperty`` from source to destination object.
Return the primary column or expression for this ColumnProperty. E.g.:: class File(Base): # ... name = Column(String(64)) extension = Column(String(8)) filename = column_property(name + '.' + extension) path = column_property('C:/' + filename.expression) .. seealso:: :ref:`mapper_column_property_sql_expressions_composed`
def _memoized_attr__deferred_column_loader(self) ->
_InstallLoaderCallableProto[ Any]
:
(source)
¶
Undocumented
def _memoized_attr__raise_column_loader(self) ->
_InstallLoaderCallableProto[ Any]
:
(source)
¶
Undocumented