Repository URL to install this package:
Version:
4.0.108 ▾
|
contego
/
home
/
tvault
/
.virtenv
/
lib
/
python2.7
/
site-packages
/
sqlalchemy
/
orm
/
interfaces.pyc
|
---|
ó EYc @@ s4 d Z d d l m Z d d l m Z d d l m Z d d l m Z m Z m Z m Z m Z m Z d d l m Z m Z m Z m Z d d l Z d d l m Z d Z Z Z d Z d e e e j f d YZ d e j f d YZ d e f d YZ d e f d YZ d e f d YZ d S( sI Contains various base classes used throughout the ORM. Defines some key base classes prominent within the internals, as well as the now-deprecated ORM extension classes. Other than the deprecated extensions, this module and the classes within are mostly private, though some attributes are exposed when inspecting mappings. i ( t absolute_importi ( t util( t operatorsi ( t ONETOMANYt MANYTOONEt MANYTOMANYt EXT_CONTINUEt EXT_STOPt NOT_EXTENSION( t InspectionAttrR t InspectionAttrInfot _MappedAttributeN( t inspectt AttributeExtensionR R R R R R t LoaderStrategyt MapperExtensiont MapperOptiont MapperPropertyt PropComparatort SessionExtensiont StrategizedPropertyc B@ s¤ e Z d Z d Z e Z e Z d Z d Z d Z d d d Z d Z d Z d Z d Z e d Z d Z d Z d Z d Z RS( s Represent a particular class attribute mapped by :class:`.Mapper`. The most common occurrences of :class:`.MapperProperty` are the mapped :class:`.Column`, which is represented in a mapping as an instance of :class:`.ColumnProperty`, and a reference to another class produced by :func:`.relationship`, represented in the mapping as an instance of :class:`.RelationshipProperty`. t _configure_startedt _configure_finishedt parentt keyt infoc C@ s i S( sR Info dictionary associated with the object, allowing user-defined data to be associated with this :class:`.InspectionAttr`. The dictionary is generated when first accessed. Alternatively, it can be specified as a constructor argument to the :func:`.column_property`, :func:`.relationship`, or :func:`.composite` functions. .. versionadded:: 0.8 Added support for .info to all :class:`.MapperProperty` subclasses. .. versionchanged:: 1.0.0 :attr:`.MapperProperty.info` is also available on extension types via the :attr:`.InspectionAttrInfo.info` attribute, so that it can apply to a wider variety of ORM and extension constructs. .. seealso:: :attr:`.QueryableAttribute.info` :attr:`.SchemaItem.info` ( ( t self( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt _memoized_attr_infoU s c K@ s d S( s Called by Query for the purposes of constructing a SQL statement. Each MapperProperty associated with the target mapper processes the statement referenced by the query context, adding columns and/or criterion as appropriate. N( ( R t contextt entityt patht adaptert kwargs( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt setupo s c C@ s d S( sc Produce row processing functions and append to the given set of populators lists. N( ( R R R t mappert resultR t populators( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt create_row_processorx s c C@ s t d S( s Iterate through instances related to the given instance for a particular 'cascade', starting with this MapperProperty. Return an iterator3-tuples (instance, mapper, state). Note that the 'cascade' collection on this MapperProperty is checked first for the given type before cascade_iterator is called. This method typically only applies to RelationshipProperty. ( ( t iter( R t type_t statet visited_instancest halt_on( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt cascade_iterator s c C@ s | | _ d S( s¹ Set the parent mapper that references this MapperProperty. This method is overridden by some subclasses to perform extra setup when the mapper is first known. N( R ( R R t init( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt set_parent s c C@ s d S( sI 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). N( ( R R" ( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt instrument_class s c C@ s t | _ t | _ d S( N( t FalseR R ( R ( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt __init__¬ s c C@ s t | _ | j t | _ d S( s¥ Called after all mappers are created to assemble relationships between mappers and perform other post-mapper-creation initialization steps. N( t TrueR t do_initR ( R ( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyR, ° s c C@ s t | j j | j S( s® Return the class-bound descriptor corresponding to this :class:`.MapperProperty`. This is basically a ``getattr()`` call:: return getattr(self.parent.class_, self.key) I.e. if this :class:`.MapperProperty` were named ``addresses``, and the class to which it is mapped is ``User``, this sequence is possible:: >>> from sqlalchemy import inspect >>> mapper = inspect(User) >>> addresses_property = mapper.attrs.addresses >>> addresses_property.class_attribute is User.addresses True >>> User.addresses.property is addresses_property True ( t getattrR t class_R ( R ( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt class_attributeº s c C@ s d S( sº Perform subclass-specific initialization post-mapper-creation steps. This is a template method called by the ``MapperProperty`` object's init() method. N( ( R ( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyR2 Ô s c C@ s d S( s Perform instrumentation adjustments that need to occur after init() has completed. The given Mapper is the Mapper invoking the operation, which may not be the same Mapper as self.parent in an inheritance scenario; however, Mapper will always at least be a sub-mapper of self.parent. This method is typically used by StrategizedProperty, which delegates it to LoaderStrategy.init_class_attribute() to perform final setup on the class-bound InstrumentedAttribute. N( ( R R" ( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt post_instrument_classÝ s c C@ s d S( so Merge the attribute represented by this ``MapperProperty`` from source to destination object. N( ( R t sessiont source_statet source_dictt dest_statet dest_dictt loadt _recursive( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt mergeì s c C@ s) d | j j t | t | d d f S( Ns <%s at 0x%x; %s>R s no key( t __class__t __name__t idR3 ( R ( ( sN /home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.pyt __repr__ó s ( s _configure_starteds _configure_finisheds parents keys infoN( R@ t __module__t __doc__t __slots__t frozensett cascadeR1 t is_propertyR R! R% t NoneR+ R- R. R0 R, t propertyR5 R2 R6 R>