%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyc

�
��4]c@sSdZddlZddlmZddlmZddlmZddlmZddlmZej	d	d
�Z
ej	dd�Zej	d
d�Zej	dd�Z
ej	dd�Zej	dddd�Zej	dddd�Zej	dddd�Zej	dddd�Zej	dddd �Zej	d!d"dd#�Zej	d$d%dd&�Zej	d'd(dd)�Zej	d*d+dd,�Zej	d-d.deeBeBeBeB�Zej	d/d0deeA�Zej	d1d2deeA�Zej	d3d4deeA�Zej	d5d6deeA�Zej	d7d8deeA�Zd9Zd:ZdeZ ej	d=�Z!ej	d>�Z"ej	d?�Z#ej	d@dA�Z$ej	dBdC�Z%ej	dDdE�Z&ej	dFdG�Z'e(eg�Z)e(dee
g�Z+ej	dH�Z,ej	dI�Z-dJ�Z.dK�Z/ej0e�Z1ej0dL�Z2dM�Z3dN�Z4dO�Z5dP�Z6dQ�Z7dR�Z8dS�Z9ej:e;�dT��Z<dU�Z=dV�Z>dW�Z?dX�Z@dY�ZAdZ�ZBd[�ZCejDd\�ZEej:eF�eGd]��ZHeId^�ZJd_e;fd`��YZKdaeKfdb��YZLdce;fdd��YZMdS(fs=Constants and rudimental functions used throughout the ORM.

i����Ni(texci(t
inspection(tutil(t
expressiontPASSIVE_NO_RESULTs�Symbol returned by a loader callable or other attribute/history
    retrieval operation when a value could not be determined, based
    on loader callable flags.
    tATTR_WAS_SETs�Symbol returned by a loader callable to indicate the
    retrieved value, or values, were assigned to their attributes
    on the target object.
    t
ATTR_EMPTYs@Symbol used internally to indicate an attribute had no callable.tNO_VALUEs�Symbol which may be placed as the 'previous' value of an attribute,
    indicating no value was loaded for an attribute when it was modified,
    and flags indicated we were not to load it.
    t	NEVER_SETs�Symbol which may be placed as the 'previous' value of an attribute
    indicating that the attribute had not been assigned to previously.
    t	NO_CHANGEs]No callables or SQL should be emitted on attribute access
    and no state should change
    t	canonicalitCALLABLES_OKsELoader callables can be fired off if a value
    is not present.
    tSQL_OKsBLoader callables can emit SQL at least on scalar value attributes.tRELATED_OBJECT_OKsZCallables can use SQL to load related objects as well
    as scalar value attributes.
    itINIT_OKs�Attributes should be initialized with a blank
    value (None or an empty collection) upon get, if no other
    value can be obtained.
    itNON_PERSISTENT_OKs9Callables can be emitted if the parent is not persistent.itLOAD_AGAINST_COMMITTEDsUCallables should use committed values as primary/foreign keys during a
    load.
    i tNO_AUTOFLUSHs*Loader callables should disable autoflush.i@tNO_RAISEs0Loader callables should not raise any assertionsi�tPASSIVE_OFFs&Callables can be emitted in all cases.tPASSIVE_RETURN_NEVER_SETsPASSIVE_OFF ^ INIT_OKtPASSIVE_NO_INITIALIZEs'PASSIVE_RETURN_NEVER_SET ^ CALLABLES_OKtPASSIVE_NO_FETCHsPASSIVE_OFF ^ SQL_OKtPASSIVE_NO_FETCH_RELATEDsPASSIVE_OFF ^ RELATED_OBJECT_OKtPASSIVE_ONLY_PERSISTENTsPASSIVE_OFF ^ NON_PERSISTENT_OKt_sa_class_managert_sa_instance_statetmappertinstrumentortEXT_CONTINUEtEXT_STOPtEXT_SKIPt	ONETOMANYs�Indicates the one-to-many direction for a :func:`.relationship`.

    This symbol is typically used by the internals but may be exposed within
    certain API features.

    t	MANYTOONEs�Indicates the many-to-one direction for a :func:`.relationship`.

    This symbol is typically used by the internals but may be exposed within
    certain API features.

    t
MANYTOMANYs�Indicates the many-to-many direction for a :func:`.relationship`.

    This symbol is typically used by the internals but may be exposed within
    certain API features.

    t
NOT_EXTENSIONs�Symbol indicating an :class:`InspectionAttr` that's
    not part of sqlalchemy.ext.

    Is assigned to the :attr:`.InspectionAttr.extension_type`
    attribute.

    tSET_DEFERRED_EXPIREDtDEFER_FOR_STATEcstj�fd��}|S(s1Mark a method as generative, e.g. method-chained.csI|dj�}x�D]}|||j�qW|||d|�|S(Nii(t_clonet__name__(tfntargstkwtselft	assertion(t
assertions(sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pytgenerate�s

(Rt	decorator(R-R.((R-sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt_generative�scCs|jjtd�S(N(t__dict__tgettDEFAULT_MANAGER_ATTRtNone(tcls((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pytmanager_of_class�sR1cCstt|��S(s'Return a string describing an instance.(t	state_strtinstance_state(tinstance((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pytinstance_str�scCs4|dkrdSd|jjt|j��fSdS(s=Return a string describing an instance via its InstanceState.R4s<%s at 0x%x>N(R4tclass_R'tidtobj(tstate((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyR7�scCs%|dkrdSd|jjfSdS(sNReturn a string describing an instance's class via its
    InstanceState.
    R4s<%s>N(R4R;R'(R>((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pytstate_class_str�scCst|�d|S(Nt.(R:(R9t	attribute((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt
attribute_strscCst|�d|S(NR@(R7(R>RA((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pytstate_attribute_strscCs
t|�jS(s�Given an object, return the primary Mapper associated with the object
    instance.

    Raises :class:`sqlalchemy.orm.exc.UnmappedInstanceError`
    if no mapping is configured.

    This function is available via the inspection system as::

        inspect(instance).mapper

    Using the inspection system will raise
    :class:`sqlalchemy.exc.NoInspectionAvailable` if the instance is
    not part of a mapping.

    (tobject_stateR(R9((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt
object_mapperscCs2t|�}|dkr*tj|��n|SdS(s�Given an object, return the :class:`.InstanceState`
    associated with the object.

    Raises :class:`sqlalchemy.orm.exc.UnmappedInstanceError`
    if no mapping is configured.

    Equivalent functionality is available via the :func:`.inspect`
    function as::

        inspect(instance)

    Using the inspection system will raise
    :class:`sqlalchemy.exc.NoInspectionAvailable` if the instance is
    not part of a mapping.

    N(t_inspect_mapped_objectR4RtUnmappedInstanceError(R9R>((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyRD"scCs>yt|�SWn)tjk
r%dStjk
r9dSXdS(N(R8RtUnmappedClassErrorR4tNO_STATE(R9((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyRF:scCs8tj|t�}|dk	r%|jStj|��dS(N(RtinspecttFalseR4RRRH(tclass_or_mappertinsp((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt_class_to_mapperFscCs-tj|t�}|dk	r%|jSdSdS(s\Return the :class:`.Mapper` for the given class or None if the
    class is not mapped.
    N(RRJRKR4R(tentityRM((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt_mapper_or_noneNscCs8tj|t�}|dk	o7|jo7|jp7|jS(shReturn True if the given object is a mapped class,
    :class:`.Mapper`, or :class:`.AliasedClass`.
    N(RRJRKR4tis_clause_elementt	is_mappertis_aliased_class(RORM((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt_is_mapped_classZs
cCs't|d�r|jStj|�SdS(Ntkey(thasattrRURt_column_as_key(tattr((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt_attr_as_keygscCs[tj|t�}t|d�rPt|jd�rPg|jjD]}|^q@S|gSdS(Nt
selectabletc(RRJRKRVRZR[(RORMR[((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt_orm_columnsns!cCs.tj|t�}|dk	o-t|dt�S(NRS(RRJRKR4tgetattr(RORM((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt_is_aliased_classvscCs�tj|�}|jr*|}|j}nC|jrE|j}|}n(t|d�rg|jj}}n|}yt	||�SWn*t
k
r�tjd||f��nXdS(s�Return a class attribute given an entity and string name.

    May return :class:`.InstrumentedAttribute` or user-defined
    attribute.

    Rs Entity '%s' has no property '%s'N(
RRJt
is_selectableR[RSRORVRR;R]tAttributeErrortsa_exctInvalidRequestError(RORURMtdescription((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt_entity_descriptor{s				
smanager.mappercCsby&t|�}|jsdS|j}Wntjk
r=dSX|rZ|jrZ|j�n|SdS(N(R6t	is_mappedR4RRRIt_new_mapperst_configure_all(R;t	configuret
class_managerR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt_inspect_mapped_class�s	

cCs`t|d|�}|dkrXt|t�sFtjd|f��ntj|��n|SdS(s�Given a class, return the primary :class:`.Mapper` associated
    with the key.

    Raises :exc:`.UnmappedClassError` if no mapping is configured
    on the given class, or :exc:`.ArgumentError` if a non-class
    object is passed.

    Equivalent functionality is available via the :func:`.inspect`
    function as::

        inspect(some_mapped_class)

    Using the inspection system will raise
    :class:`sqlalchemy.exc.NoInspectionAvailable` if the class is not mapped.

    Rhs Class object expected, got '%r'.N(RjR4t
isinstancettypeRat
ArgumentErrorRRH(R;RhR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pytclass_mapper�stInspectionAttrcBsJeZdZdZeZeZeZeZeZ	eZ
eZeZe
ZRS(s A base class applied to all ORM objects that can be returned
    by the :func:`.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.

    ((R't
__module__t__doc__t	__slots__RKR_RStis_instanceRRtis_propertytis_attributet_is_internal_proxyRQR#textension_type(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyRo�s
tInspectionAttrInfocBs eZdZejd��ZRS(sAdds the ``.info`` attribute to :class:`.InspectionAttr`.

    The rationale for :class:`.InspectionAttr` vs. :class:`.InspectionAttrInfo`
    is that the former is compatible as a mixin for classes that specify
    ``__slots__``; this is essentially an implementation artifact.

    cCsiS(s�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.

        .. 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`

        ((R+((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pytinfos(R'RpRqRtmemoized_propertyRy(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyRx
st_MappedAttributecBseZdZdZRS(sVMixin for attributes which should be replaced by mapper-assigned
    attributes.

    ((R'RpRqRr(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyR{/s(RR(NRqtoperatortRRaRRtsqlRtsymbolRRRRRR	RRR
RRRRRRRRRRRR3tDEFAULT_STATE_ATTRt
_INSTRUMENTORRRRR R!R"R#t	frozensett
_never_setR4t	_none_sett_SET_DEFERRED_EXPIREDt_DEFER_FOR_STATER0R6t
attrgetterR8t
instance_dictR:R7R?RBRCRERDt	_inspectstobjectRFRNRPRTRYR\R^Rdtdottedgettert
_state_mapperRlRKRjtTrueRnRoRxR{(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/base.pyt<module>
s�														



																	
				I"

Zerion Mini Shell 1.0