/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm
NameSizeModeActions
attributes.py671370644editdlrm
attributes.pyc621290644editdlrm
attributes.pyo618510644editdlrm
base.py148640644editdlrm
base.pyc155580644editdlrm
base.pyo155580644editdlrm
collections.py526140644editdlrm
collections.pyc634480644editdlrm
collections.pyo632260644editdlrm
dependency.py465560644editdlrm
dependency.pyc296240644editdlrm
dependency.pyo295330644editdlrm
deprecated_interfaces.py207510644editdlrm
deprecated_interfaces.pyc227760644editdlrm
deprecated_interfaces.pyo227760644editdlrm
descriptor_props.py282010644editdlrm
descriptor_props.pyc322160644editdlrm
descriptor_props.pyo322160644editdlrm
dynamic.py146660644editdlrm
dynamic.pyc153390644editdlrm
dynamic.pyo153390644editdlrm
evaluator.py54410644editdlrm
evaluator.pyc78190644editdlrm
evaluator.pyo78190644editdlrm
events.py944090644editdlrm
events.pyc1036650644editdlrm
events.pyo1036650644editdlrm
exc.py66100644editdlrm
exc.pyc88380644editdlrm
exc.pyo88380644editdlrm
identity.py102990644editdlrm
identity.pyc151090644editdlrm
identity.pyo151090644editdlrm
instrumentation.py181310644editdlrm
instrumentation.pyc216330644editdlrm
instrumentation.pyo215440644editdlrm
interfaces.py257660644editdlrm
interfaces.pyc302340644editdlrm
interfaces.pyo302340644editdlrm
loading.py322360644editdlrm
loading.pyc205740644editdlrm
loading.pyo205490644editdlrm
mapper.py1283440644editdlrm
mapper.pyc1004120644editdlrm
mapper.pyo1001980644editdlrm
path_registry.py92620644editdlrm
path_registry.pyc132560644editdlrm
path_registry.pyo132560644editdlrm
persistence.py656520644editdlrm
persistence.pyc467860644editdlrm
persistence.pyo467860644editdlrm
properties.py110430644editdlrm
properties.pyc121110644editdlrm
properties.pyo121110644editdlrm
query.py1725900644editdlrm
query.pyc1550140644editdlrm
query.pyo1549360644editdlrm
relationships.py1244420644editdlrm
relationships.pyc1053180644editdlrm
relationships.pyo1052930644editdlrm
scoping.py63930644editdlrm
scoping.pyc76800644editdlrm
scoping.pyo76800644editdlrm
session.py1287540644editdlrm
session.pyc1201170644editdlrm
session.pyo1199380644editdlrm
state.py310440644editdlrm
state.pyc322940644editdlrm
state.pyo322380644editdlrm
strategies.py846020644editdlrm
strategies.pyc630190644editdlrm
strategies.pyo626680644editdlrm
strategy_options.py555050644editdlrm
strategy_options.pyc527300644editdlrm
strategy_options.pyo525960644editdlrm
sync.py55360644editdlrm
sync.pyc46280644editdlrm
sync.pyo46280644editdlrm
unitofwork.py247350644editdlrm
unitofwork.pyc245650644editdlrm
unitofwork.pyo244890644editdlrm
util.py448590644editdlrm
util.pyc443630644editdlrm
util.pyo442110644editdlrm
__init__.py95420644editdlrm
__init__.pyc107590644editdlrm
__init__.pyo107590644editdlrm
Edit: /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyo (21544B)
ó ÃÌ4]c@s dZddlmZddlmZddlmZddlmZddlmZddlmZejƒZ d e fd „ƒYZ d e fd „ƒYZ d e fd„ƒYZeƒZejZZejZZejZZd„Zd„Zd„Zd„ZdS(sœDefines SQLAlchemy's system of class instrumentation. This module is usually not directly visible to user applications, but defines a large part of the ORM's interactivity. instrumentation.py deals with registration of end-user classes for state tracking. It interacts closely with state.py and attributes.py which establish per-instance and per-class-attribute instrumentation, respectively. The class instrumentation system can be customized on a per-class or global basis using the :mod:`sqlalchemy.ext.instrumentation` module, which provides the means to build and specify alternate instrumentation forms. .. versionchanged: 0.8 The instrumentation extension system was moved out of the ORM and into the external :mod:`sqlalchemy.ext.instrumentation` package. When that package is imported, it installs itself within sqlalchemy.orm so that its more comprehensive resolution mechanics take effect. i(tbase(t collections(texc(t interfaces(tstatei(tutilt ClassManagercBs6eZdZejZejZee j eƒƒZ d,Z ejZd,Zd„Zd„Zd„Zed„ƒZed„ƒZed„ƒZed„ƒZe jd„ƒZd,d „Zd,d „Zd „Zd „Zd „Z d„Z!e jd„ƒZ"d„Z#d„Z$e j%d„ƒZ&e j%d„ƒZ'e j%d„ƒZ(e)d„Z*d„Z+d„Z,e)d„Z-d„Z.d„Z/d„Z0d„Z1d„Z2d„Z3d„Z4e)d „Z5d!„Z6ed"„ƒZ7d,d#„Z8d,d$„Z9d%„Z:d&„Z;d'„Z<d(„Z=e)d)„Z>d*„Z?e?Z@d+„ZARS(-s,tracks state information at the class level.cCs7||_i|_d|_i|_i|_gg|jjD]!}t|tƒr=t |ƒ^q=D]}|dk rb|^qb|_ x|j D]}|j |ƒqW|j j j||ƒx?|jD]4}t |ƒ}|dk rÄ|j j|j ƒqÄqÄW|jƒ|jƒd|jkr3tjd|ƒndS(Nt__del__s¦__del__() method on class %s will cause unreachable cycles and memory leaks, as SQLAlchemy instrumentation often creates reference cycles. Please remove this method.(tclass_tinfotNonetnew_initt local_attrst originalst __bases__t isinstancettypetmanager_of_classt_basestupdatetdispatcht_eventst_new_classmanager_instancet__mro__t_updatetmanaget_instrument_initt__dict__Rtwarn(tselfRRtmgrtbase_tbasecls((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt__init__:s.     %    cCs t|ƒS(N(tid(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt__hash__`scCs ||kS(N((Rtother((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt__eq__cscCs d|jkS(Ntmapper(R(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt is_mappedfscCs t|ƒS(N(t frozenset(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt _all_key_setjscCs2tg|jƒD]}|jjr|j^qƒS(N(R(tvaluestimplt collectiontkey(Rtattr((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt_collection_impl_keysnscCs2tg|jƒD]}|jjr|j^qƒS(N(R(R*R+taccepts_scalar_loader(RR.((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt_scalar_loader_implstscCstj|jƒ‚dS(N(RtUnmappedClassErrorR(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyR&~sccs™|dkrtƒ}nxz|jjD]l}xct|jƒj|ƒD]I}|j|ƒ|j|}t|tj ƒrD|j rD||fVqDqDWq%WdS(sreturn an iterator of all classbound attributes that are implement :class:`.InspectionAttr`. This includes :class:`.QueryableAttribute` as well as extension types such as :class:`.hybrid_property` and :class:`.AssociationProxy`. N( R tsetRRRt differencetaddRRtInspectionAttrt is_attribute(RtexcludetsuperclsR-tval((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt_all_sqla_attributesƒs     cCs9x2|jjD] }||jkr |j|Sq W|SdS(s5return an attribute on the class without tripping it.N(RRR(RR-tdefaultR9((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt_get_class_attr_mro˜scCs||ko||jdk S(s\Return True if the given attribute is fully initialized. i.e. has an impl. N(R+R (RR-((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt_attr_has_impl¡scCs.t|ƒ}|dkr*tj|ƒ}n|S(sÏCreate a new ClassManager for a subclass of this ClassManager's class. This is called automatically when attributes are instrumented so that the attributes can be propagated to subclasses against their own class-local manager, without the need for mappers etc. to have already pre-configured managers for the full class hierarchy. Mappers can post-configure the auto-generated ClassManager when needed. N(RR t_instrumentation_factorytcreate_manager_for_cls(Rtclstmanager((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt_subclass_manager©s  cCs;|jj|_t|j|ƒ|_|jd|jƒdS(NR!(RR!t original_initt_generate_initR tinstall_member(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyR¹scCs&|jr"|jdƒd|_ndS(NR!(R tuninstall_memberR (R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt_uninstrument_initÃs  cCs|jj||jƒtjS(N(Rt first_initRRt InstanceState(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt_state_constructorÈscCst|j|j|ƒdS(s0Mark this instance as the manager for its class.N(tsetattrRt MANAGER_ATTR(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyRÍscCst|j|jƒdS(s)Dissasociate this manager from its class.N(tdelattrRRM(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pytdisposeÒscCstS(N(t_default_manager_getter(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pytmanager_getter×scCstS(sÍReturn a (instance) -> InstanceState callable. "state getter" callables should raise either KeyError or AttributeError if no InstanceState could be found for the instance. (t_default_state_getter(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt state_getterÛs cCstS(N(t_default_dict_getter(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt dict_getteræscCs|r||jkr9dSn||j|<|j||ƒtj|ƒ|||s cCs!|r||kS||jkSdS(N(R (RR-tsearch((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pytis_instrumentedEs cCs ||jS(N(R+(RR-((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyRsKscCst|jƒƒS(N(titerR*(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt attributesNscCsJ|jj|jƒ}|dkr6|j||ƒ}n|j||ƒ|S(N(Rt__new__R RKt _state_setter(RRtinstance((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt new_instanceTs  cCs5|dkr!|j||ƒ}n|j||ƒdS(N(R RKR}(RR~R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pytsetup_instance[s cCst||jƒdS(N(RNRh(RR~((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pytteardown_instance`scCs t||ƒS(N(t_SerializeManager(RRt state_dict((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt _serializecscCstt||jƒrtS|j|jk rJ|jrJ|j|jƒj|ƒS|j||ƒ}|j ||ƒ|SdS(sƒInstall a default InstanceState if none is present. A private convenience method used by the __init__ decorator. N( thasattrRhtFalseRt __class__R'RCt_new_state_if_noneRKR}(RR~R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyRˆfs cCst||jƒS(N(R…Rh(RR~((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt has_state|scCs|j|ƒj|d|ƒS(tTODOt optimistic(Rst hasparent(RRR-R‹((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt has_parentscCstS(s=All ClassManagers are non-zero regardless of attribute state.(R[(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt__bool__ƒscCs d|jj|jt|ƒfS(Ns<%s of %r at %x>(R‡t__name__RR"(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt__repr__‰s N(BRt __module__t__doc__RtDEFAULT_MANAGER_ATTRRMtDEFAULT_STATE_ATTRRht staticmethodRt attrsetterR}R tdeferred_scalar_loadertobjectR!RDRtR#R%tpropertyR'RWR)R/R1tmemoized_propertyR&R;R=R>RCRRHRKRROt hybridmethodRQRSRUR†RZR^RbRdRgRVRcRFRGRqRwRyRsR{RR€RR„RˆR‰RRŽt __nonzero__R(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyR,sf    &                            R‚cBs eZdZd„Zd„ZRS(s¡Provide serialization of a :class:`.ClassManager`. The :class:`.InstanceState` uses ``__init__()`` on serialize and ``__call__()`` on deserialize. cCs,|j|_|j}|jj||ƒdS(N(RRBRtpickle(RRtdRB((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyR!™s  cCsšt|jƒ|_}|dkr>tj|d|jƒ‚n&|jrd|jj rd|jj ƒn|dk rƒ|j ||ƒn|j j ||ƒdS(NsxCannot deserialize object of type %r - no mapper() has been configured for this class within the current Python process!( RRRBR RtUnmappedInstanceErrorR'R&t configuredt_configure_allR€Rtunpickle(RRR\RƒRB((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyt__call__žs  (RR‘R’R!R£(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyR‚‘s tInstrumentationFactorycBs2eZdZd„Zd„Zd„Zd„ZRS(s'Factory for new ClassManager instances.cCsc|j|ƒ\}}|dkr6t}||ƒ}n|j||ƒ||_|jj|ƒ|S(N(t_locate_extended_factoryR Rt_check_conflictsRtRtclass_instrument(RRRBRt((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyR@¶s  cCsdS(s2Overridden by a subclass to do an extended lookup.N(NN(R (RR((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyR¥ÉscCsdS(s;Overridden by a subclass to test for conflicting factories.N((RRRt((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyR¦ÍscCsYt|ƒ}|jƒ|jƒ|jj|ƒtj|jkrUt|tjƒndS(N( RRgRORtclass_uninstrumentRRMRRN(RRRB((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyRgÑs    (RR‘R’R@R¥R¦Rg(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyR¤³s    cCs.t|ƒ}|dkr*tj|ƒ}n|S(s_Register class instrumentation. Returns the existing or newly created class manager. N(RR R?R@(RRB((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pytregister_classès  cCstj|ƒdS(s!Unregister class instrumentation.N(R?Rg(R((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pytunregister_classõscCst|jƒj|dtƒS(sïReturn True if the given attribute on the given instance is instrumented by the attributes package. This function may be used regardless of instrumentation applied directly to the class, i.e. no descriptors are required. Rx(RR‡RyR[(R~R-((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyRyûsc Bsê|j}d}ej|deƒ}||}ejr^e|d|ƒ}e|ddƒ}n$e|ddƒ}e|ddƒ}eƒjƒ} || U| d} |j | _ || _ |rÊ|| _ nej ræ|ræ|| _ n| S( s>Build an __init__ decorator that triggers ClassManager events.sâdef __init__(%(apply_pos)s): new_state = class_manager._new_state_if_none(%(self_arg)s) if new_state: return new_state._initialize_instance(%(apply_kw)s) else: return original__init__(%(apply_kw)s) tgroupedtim_funct func_defaultst __defaults__t__kwdefaults__R!N( R!Rtformat_argspec_initR†tpy2kRkR tlocalstcopyR’t_sa_original_initR®R¯( Rt class_managertoriginal__init__t func_bodyt func_varst func_texttfuncR­tfunc_kw_defaultstenvR!((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyREs&        N(R’tRRRRRRt!group_expirable_memoized_propertyRWtdictRR˜R‚R¤R?tinstance_stateRRt instance_dictRTRRPR©RªRyRE(((sQ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/instrumentation.pyts& ÿf")