[Jc @sVdZddkZddklZlZddkZddkZddklZddkl Z l Z l Z ddk i ZdZdZdaeidZeidZeidZeid ZeZeid ZeZd ZgZd e ifd YZ de fdYZ!de"fdYZ#dZ$de"fdYZ%de%fdYZ&de&fdYZ'de&fdYZ(de%fdYZ)de i*fdYZ+de"fd YZ,d!e-fd"YZ.d#e.fd$YZ/d%e0fd&YZ1e1dddZ2d'Z3d(Z4d)Z5ed*Z6d+Z7d,Z8d-Z9edeedd.Z:ddddd/Z;d0Z<d1Z=d2Z>d3Z?d4Z@d5ZAd6ZBd7ZCd8e"fd9YZDeDZEd:ZFeEiGZGeEiHZIeFeid;d<ZJeiKeJd=ZLdS(>sDefines 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. SQLA's instrumentation system is completely customizable, in which case an understanding of the general mechanics of this module is helpful. An example of full customization is in /examples/custom_attributes. iN(t attrgettert itemgetter(tutil(t interfacest collectionstexctPASSIVE_NORESULTt ATTR_WAS_SETtNO_VALUEt NEVER_SETtPASSIVE_NO_CALLABLESt__sa_instrumentation_manager__tQueryableAttributecBs}eZd d d dZdZdZdZdZdZdZ e dZ dZ d Z ed ZRS( cCs(||_||_||_||_dS(sConstruct an InstrumentedAttribute. comparator a sql.Comparator to which class-level compare/math events will be sent N(tkeytimplt comparatort parententity(tselfR RRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt__init___s   cKs"|iit|t||S(N(Rt get_historytinstance_statet instance_dict(Rtinstancetkwargs((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRjscCs|S(N((R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt__selectable__mscCs |iiS(N(Rt__clause_element__(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRqscCs|ii|S(N(Rtlabel(Rtname((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRtscOs||i||S(N(R(RtoptotherR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytoperatewscKs|||i|S(N(R(RRRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytreverse_operatezscCs|ii|d|S(Nt optimistic(Rt hasparent(RtstateR ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR!}scCs\yt|i|SWnAtj o5tdt|it|ii|fnXdS(Ns3Neither %r object nor %r object has an attribute %r(tgetattrRtAttributeErrorttypet__name__(RR ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt __getattr__s cCst|id|iiS(Nt.(treprRtpropertyR (R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt__str__scCs |iiS(N(RR*(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR*sN(R&t __module__tNoneRRRRRRRtFalseR!R'R+R*(((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR ]s        tInstrumentedAttributecBs)eZdZdZdZdZRS(s@Public-facing descriptor, placed in the mapped class dictionary.cCs)|iit|t||ddS(N(RtsetRRR-(RRtvalue((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt__set__scCs#|iit|t|dS(N(RtdeleteRR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt __delete__scCs1|djo|S|iit|t|S(N(R-RtgetRR(RRtowner((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt__get__s (R&R,t__doc__R2R4R7(((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR/s  t _ProxyImplcBseZeZeZdZRS(cCs ||_dS(N(R (RR ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRs(R&R,R.taccepts_scalar_loadertdont_expire_missingR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR9scsXdtffdY}tid|_ti|tddd|S(sCreate an InstrumentedAttribute / user descriptor hybrid. Returns a new InstrumentedAttribute type that delegates descriptor behavior and getattr() to the given descriptor. tProxycseeZdZdZeidZfdZfdZfdZ fdZ RS(s@A combination of InsturmentedAttribute and a regular descriptor.cSs>||_||_|_||_||_t||_dS(N(R t descriptort user_propt _comparatort _parententityR9R(RR R=RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRs    cSs-ti|io|i|_n|iS(N(RtcallableR?(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscs2|djoi|||Si||S(s,Delegate __get__ to the original descriptor.N(R-R7(RRR6(R=(s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR7s csi||S(s,Delegate __set__ to the original descriptor.(R2(RRR1(R=(s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR2scs i|S(s/Delegate __delete__ to the original descriptor.(R4(RR(R=(s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR4scsyt|SWnktj o_yt|i|SWqtj o5tdtit|ii|fqXnXdS(sBDelegate __getattr__ to the original descriptor and/or comparator.s3Neither %r object nor %r object has an attribute %rN(R#R$R?R%R&(Rt attribute(R=(s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR's ( R&R,R8RRtmemoized_propertyRR7R2R4R'((R=(s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR<s RR=t from_instance(R/R%R&Rtmonkeypatch_proxied_specials(R=R<((R=s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytproxied_attribute_factorys /t AttributeImplcBseZdZeddededZedZdZdZe dZ dZ dZ e dZ e d Ze d Zd Ze d Zd ZRS(s4internal implementation for instrumented attributes.c Ks||_||_||_||_|p||_|djoti|_n ||_t i |pg|_ ||_ | |_ dS(sConstruct an AttributeImpl. \class_ associated class key string name of the attribute \callable_ optional function which generates a callable based on a parent instance, which produces the "default" values for a scalar or collection attribute when it's first accessed, if not present already. trackparent if True, attempt to track if an instance has a parent attached to it via this attribute. extension a single or list of AttributeExtension object(s) which will receive set/delete/append/remove/etc. events. compare_function a function that compares two values which are normally assignable to this attribute. active_history indicates that get_history() should always return the "old" value, even if it means executing a lazy callable upon attribute change. This flag is set to True if any extensions are present. parent_token Usually references the MapperProperty, used as a key for the hasparent() function to identify an "owning" attribute. Allows multiple AttributeImpls to all match a single owner attribute. dont_expire_missing if True, don't add an "expiry" callable to this attribute during state.expire_attributes(None), if no value is present for this key. N(tclass_R t callable_t trackparentt parent_tokenR-toperatorteqtis_equalRtto_listt extensionstactive_historyR;( RRHR RIRJt extensiontcompare_functionRQRKR;R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRs0       cCs|iit|i|S(s+Return the boolean value of a `hasparent` flag attached to the given item. The `optimistic` flag determines what the default return value should be if no `hasparent` flag can be located. As this function is used to determine if an instance is an *orphan*, instances that were loaded from storage should be assumed to not be orphans, until a True/False value for this flag is set. An instance attribute that is loaded by a callable function will also not have a `hasparent` flag. (tparentsR5tidRK(RR"R ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR!$scCs||it|i|i||}|i|||||}|||is(t _set_iterable(RR"R[R1Rc((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR0s   c Cs|i|\}}|ot|||}n t|}|i||}||jodS|i||t||i|||} |||i|ii|i_t|i||_|id|idS(NR(RHRRRt_generate_initRtinstall_member(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscCs(|io|idd|_ndS(NR(Rtuninstall_memberR-(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt_uninstrument_inits  cCsPtdjoddklan|ioti||Sti||SdS(Ni(R"(R"R-tsqlalchemy.ormRxtMutableAttrInstanceStatet InstanceState(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt_create_instance_states   cCst|i|i|dS(s0Mark this instance as the manager for its class.N(RRHt MANAGER_ATTR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscCst|i|idS(s)Dissasociate this manager from its class.N(tdelattrRHR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytdisposescCs t|iS(N(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytmanager_getterscCs|o||ijodSn||i|<|i||||| InstanceState callable. "state getter" callables should raise either KeyError or AttributeError if no InstanceState could be found for the instance. (RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt state_getter<scCs tdS(Nt__dict__(R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt dict_getterFscCst||iS(N(RR(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt has_stateIscCs|i|i|d|S(tTODOR (RR!(RR"R R ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt has_parentLscCstS(s=All ClassManagers are non-zero regardless of attribute state.(Rt(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt __nonzero__PscCs d|ii|it|fS(Ns<%s of %r at %x>(t __class__R&RHRU(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt__repr__TsN(+R&R,R8RRRRR-RRRRRRRRRRR.RRRRRRRRR RRRR*RRRRRRRRRRR (((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRcsL                         t_ClassInstrumentationAdaptercBseZdZdZdZdZdZedZdZ dZ dZ d Z d Z d Zd Zdd ZdZddZdZdZdZdZRS(s?Adapts a user-defined InstrumentationManager to a ClassManager.cKsJ||_|ii||_|ii||_ti|||dS(N(t_adaptedRt _get_stateRt _get_dictRR(RRHtoverridetkw((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR[s cCs|ii|i|dS(N(R"RRH(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRbscCs|ii|idS(N(R"RRH(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRescCs|ii|iS(N(R"RRH(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRhscCs>ti|||||p|ii|i||ndS(N(RRR"RH(RR RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRkscCs!|ii|i|||dS(N(R"RRH(RR ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRpscCs|ii|i||dS(N(R"RRH(RR R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRsscCs|ii|i|dS(N(R"RRH(RR ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRvscCs|ii|i||dS(N(R"RRH(RR R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRyscCs|ii|i|dS(N(R"RRH(RR ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR|scCs|ii|i||S(N(R"R RH(RR R ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR s cCsGt|idd}|o||||Sti||||SdS(NR(R#R"R-RR(RR R"Rtdelegate((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscCs)|ii|i}|i|||S(N(RHRR(RR"R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscCs&|i|otS|i|SdS(sInstall a default InstanceState if none is present. A private convenience method used by the __init__ decorator. N(RR.R(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscCsS|ii|i||djo|i|}n|ii|i|||S(N(R"tinitialize_instance_dictRHR-Rt install_state(RRR"((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRs  cCs|ii|i|dS(N(R"t remove_stateRH(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscCs5y|i|}tSWntij otSXdS(N(R#RtRtNO_STATER.(RRR"((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRs cCs|iS(N(R#(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscCs|iS(N(R$(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRsN(R&R,R8RRRRR.RRRRRRR RR-RRRRRRR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR!Xs(                RncBseZdZd ZeedZeedZeedZdZ dZ dZ dZ dZ d Zd Zed ZRS( sgA 3-tuple of added, unchanged and deleted values. Each tuple member is an iterable sequence. iiicCsti||||fS(N(ttupleR(RRRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscCs |tjS(N(R(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscCs|i|i|iS(N(RRR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytsumscCs|i|iS(N(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt non_deletedscCs|i|iS(N(RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt non_addedscCst|ip|iS(N(RRR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt has_changessc Cstg}|iD]'}||dj o t|pdq~g}|iD]'}||dj o t|pdqL~g}|iD]'}||dj o t|pdq~S(N(RnRR-RRR(RRtct_[2]t_[3]((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytas_states;;c Cs|ii|it}t|do|i||i|}|tjo|t|ddS|tjo|dt|dSt i |}t i |}|g}|D]}||jo ||qq~g} |D]}||jo | |qq~ g} |D]}||jo | |qq~ Sn|tjo:|dttgjo |g} nd} |dd| S|tjo||gd d S|tjp|i ||t jo|d |gd S|dj o |g} nd } ||gd| SdS(NR((((((((((((((R_R5R R RRRiRRRt IdentitySetR-RNRt( RRBR"RR t current_sett original_setRtxR2R3R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRos6  //7      ((R&R,R8t __slots__R*RRRRRRR-R.R/R0R4t classmethodRo(((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRns       cCs't|tipt|}n|S(N(RR"RR(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt_conditional_instance_statescKstt|||S(sReturn a History record for the given object and attribute key. obj is an instrumented object instance. An InstanceState is accepted directly for backwards compatibility but this usage is deprecated. (tget_state_historyR;(RR R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRscKs|i||S(N(R(R"R R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR<scCs+t|}t|}|i|||S(R(RRR(RRR R RR"((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRs  cKs0t|}|djot||}n|S(sbRegister class instrumentation. Returns the existing or newly created class manager. N(RR-R(RHR&R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytregister_classs  cCsti|dS(s!Unregister class instrumentation.N(tinstrumentation_registryR(RH((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytunregister_class&scKsk|idd}|idd}|idd}t||||||pt|||ndS(Ntproxy_propertyRR(RhR-tregister_descriptortregister_attribute_impl(RHR R&R@RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytregister_attribute+s c Kst|}|o/|idd} |i|| pt} n|idd} |o|||| |} n|ot|||d| |} n\|ot||||} n<|ot|||d||} nt||||} | ||_ |i |dS(NRR}( RRhR-R RRRRvRjRR( RHR tuselistRIt useobjecttmutable_scalarst impl_classR&RRRR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRB5s&  c Csdt|}|o%t|}|||||}nt|d|d|}|i||dS(NRR(RRFR/R( RHR R@RRt property_Rt proxy_typeR=((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRASs   cCst|i|dS(N(RR(RHR ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytunregister_attribute^scCs%t|}|i}t|||S(svInitialize a collection attribute and return the collection adapter. This function is used to provide direct access to collection internals for a previously unloaded attribute. e.g.:: collection_adapter = init_collection(someobject, 'elements') for elem in values: collection_adapter.append_without_event(elem) For an easier way to do the above, see :func:`~sqlalchemy.orm.attributes.set_committed_value`. obj is an instrumented object instance. An InstanceState is accepted directly for backwards compatibility but this usage is deprecated. (R;Ritinit_state_collection(RR R"R[((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytinit_collectionas  cCs4|i|}|i||}|i|||S(sDInitialize a collection attribute and return the collection adapter.(RRWR(R"R[R tattrR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRKvscCs9t|t|}}|i|i|||dS(sdSet the value of an attribute with no history events. Cancels any previous history present. The value should be a scalar value for scalar-holding attributes, or an iterable for any collection-holding attribute. This is the same underlying method used when a lazy loader fires off and loads additional data from the database. In particular, this method can be used by application code which has loaded additional attributes or collections through separate queries, which can then be attached to an instance as though it were part of its original loaded state. N(RRRRb(RR R1R"R[((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRb}scCs<t|t|}}|i|i|||ddS(sVSet the value of an attribute, firing history events. This function may be used regardless of instrumentation applied directly to the class, i.e. no descriptors are required. Custom attribute management schemes will need to make usage of this method to establish attribute state as understood by SQLAlchemy. N(RRRR0R-(RR R1R"R[((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt set_attributes cCs2t|t|}}|i|i||S(s^Get the value of an attribute, firing any callables required. This function may be used regardless of instrumentation applied directly to the class, i.e. no descriptors are required. Custom attribute management schemes will need to make usage of this method to make usage of attribute state as understood by SQLAlchemy. (RRRR5(RR R"R[((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt get_attributes cCs6t|t|}}|i|i||dS(sUDelete the value of an attribute, firing history events. This function may be used regardless of instrumentation applied directly to the class, i.e. no descriptors are required. Custom attribute management schemes will need to make usage of this method to establish attribute state as understood by SQLAlchemy. N(RRRR3(RR R"R[((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt del_attributes cCst|ii|dtS(sReturn 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. R(RRRRt(RR ((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRstInstrumentationRegistrycBsneZdZeiZeiZeiZ e Z dZ dZ dZdZdZdZRS(s/Private instrumentation registration singleton.cKsY|dj ptt|djptx2tD]$}||}|dj oPq5q5Wt}|i|i|g}|o#td|it |fn||}t |tpt ||}n|tjo"|i ot |_ t|n|i|||_|i|i|<|i|i|<|i|i|<|S(NsRmultiple instrumentation implementations specified in %s inheritance hierarchy: %r(R-tAssertionErrorRtinstrumentation_findersRt!_collect_management_factories_fort differencet TypeErrorR&RRR!t _extendedRtt_install_lookup_strategyRRRt_manager_findersRt_state_findersRt _dict_finders(RRHR&tfinderRtexisting_factoriesR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytcreate_manager_for_clss4        cCsti|}t}x}|D]u}t|}|dj o|i|iqx2tD]$}||}|dj oPqYqYWd}|i|qW|id|S(s\Return a collection of factories in play or specified for a hierarchy. Traverses the entire inheritance graph of a cls and returns a collection of instrumentation factories for those classes. Factories are extracted from active ClassManagers, if available, otherwise instrumentation_finders is consulted. N( Rtclass_hierarchyR0RR-RyRRStdiscard(RRt hierarchyt factoriestmemberRR\R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRTs        cCsH|djodSy|i|}Wntj odSX||SdS(N(R-RYR^(RRR\((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRs cCsb|djotdny|i|i|SWn&tj otd|inXdS(NsNone has no persistent state.s%r is not instrumented(R-R$RZRR^(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytstate_ofs  cCsb|djotdny|i|i|SWn&tj otd|inXdS(NsNone has no persistent state.s%r is not instrumented(R-R$R[RR^(RR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pytdict_ofs  cCsY||ijoE|i|}|i|i|i|=|i|=|i|=ndS(N(RYRRRRZR[(RRHR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyR!s    (R&R,R8tweakreftWeakKeyDictionaryRYRtWeakIdentityMappingRZR[R.RWR^RTRRdReR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRQs    #  cCsK|tidjottiatdantiati adS(s;Replace global class/object management functions with either faster or more comprehensive implementations, based on whether or not extended class instrumentation has been detected. This function is called only by InstrumentationRegistry() and unit tests specific to this behavior. tnativeRN( RtsymbolRRRRRR>RdRe(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRX,s  RicCst|tdS(s;Find user-specified instrumentation management for a class.N(R#tINSTRUMENTATION_MANAGERR-(R((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyt%find_native_user_instrumentation_hookBsc Bs|i}|ptd}ei|de}||}e|d|}e|dd}ei}||U|d} |i | _ |o || _ n| S(s>Build an __init__ decorator that triggers ClassManager events.sdef __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_defaultsRN( RRRRtformat_argspec_initR.R#R-tlocalsR|R8Ro( RHR}toriginal__init__t func_bodyt func_varst func_texttfuncRotenvR((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyRGs      (MR8RLRRRRft sqlalchemyRRRRRtsqlalchemy.exceptionst exceptionsRzR-t _entity_infoRR"RjRRRR RtR`R R.RaRkRStPropComparatorR R/RR9RFRGRjRvRRtAttributeExtensionRRRiRR!R,RnRR;RR<RR=R?RCRBRARJRLRKRbRNRORPRRQR>RXRR^RRlRdR(((s=/usr/lib/python2.6/site-packages/sqlalchemy/orm/attributes.pyts|   5 =5=K'[N           j