mò &ÜGc@sàdklZdklZdklZdkZdefd„ƒYZeieƒe_ defd„ƒYZ defd„ƒYZ d e fd „ƒYZ d efd „ƒYZ d efd„ƒYZdefd„ƒYZdS((sutil(sloggingNtInstrumentedAttributecBs tZdZeƒZeeeeed„Zd„Zd„Z d„Z d„Z d„Z d„Z ed„Zd „Zed „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zeed„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s’a property object that instruments attribute access on object instances. All methods correspond to a single attribute on a particular class.c Ks¿||_||_||_||_||_||_| |_|djo'|od„|_ q|d„|_ n ||_ | djod„|_ n | |_ t i|pgƒ|_dS(NcCsg}|D] }||q ~S(N(t_[1]txty(RRR((t=/home/holguin2/public_html/spyce/sqlalchemy/orm/attributes.pytscCs|S(N(R(R((RR scCs ||jS(N(RR(RR((RR$s(tmanagertselftkeytuselistt callable_t typecallablet trackparenttmutable_scalarst copy_functiontNonet _copyfunctcompare_functiont_compare_functiontutiltto_listt extensiont extensions( RRRR R R R RRRR tkwargs((Rt__init__s            cCs|id||ƒdS(N(RtsetRtobjtvalue(RRR((Rt__set__)scCs|id|ƒdS(N(RtdeleteRR(RR((Rt __delete__+scCs"|djo|Sn|i|ƒS(N(RRRtget(RRtowner((Rt__get__-s cCs|i||ƒS(N(RRRR(RRR((Rtis_equal2scCs |i|ƒS(N(RRR(RR((Rtcopy4scCs^|ioL|i|dtƒ}|dj o"|iƒot|idR RRR4tloggertdebugtorm_utilt instance_strtvaluesRDRCR+REtorigtcommit_attributeR?R( RRR$R2RIRORRPRJR RE((RR¦sH     & !   &  cCs,||j o|i}|idƒo|d}|d=|ƒn|iot|||ƒ}n|i |ƒ}||i |i R?RCR7R'RRRRBRZR[R\(((RR s4             :   RDcBs¦tZdZed„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z e d „ƒZ d „Zd „Zd „Zd „Zd„Zd„Zed„Zed„Zd„Zd„Zd„Zed„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d„Z$d„Z%d „Z&d!„Z'd"„Z(d#„Z)d$„Z*d%„Z+d&d'„Z,d(„Z-d)„Z.d*„Z/d+„Z0d,„Z1RS(-s'instruments a list-based attribute. all mutator operations (i.e. append, remove, etc.) will fire off events to the InstrumentedAttribute that manages the object's attribute. those events in turn trigger things like backref operations and whatever is implemented by do_list_value_changed on InstrumentedAttribute. note that this list does a lot less than earlier versions of SA list-based attributes, which used HistoryArraySet. this list wrapper does *not* maintain setlike semantics, meaning you can add as many duplicates as you want (which can break a lot of SQL), and also does not do anything related to history tracking. Please see ticket #213 for information on the future of this class, where it will be broken out into more collection-specific subtypes.cCsô||_ti|ƒ|_|i|_|p |iƒ|_t |idƒo|ii |_ |i |_ n3t |idƒo|ii|_ |i|_ nt|itƒo|i|_ n|o%x"|iD]}|i|ƒqÕWndS(NRBtadd(tattrRtweakreftrefRt_InstrumentedList__objRRAR?thasattrRBt_data_appendert _clear_listt _clear_dataRat _clear_sett isinstancetdictt _clear_dictRGRt_InstrumentedList__setrecord(RRbRRARGR((RRBs    cCs/g}|iD]}||i|ƒq~dS(sjfires off delete event handlers for each item in the list but doesnt affect the original data listN(RRRARt_InstrumentedList__delrecord(RRR((RRUZscCs|iƒdS(s[clears all items in this InstrumentedList and fires off delete event handlers for each itemN(RRi(R((RR:_scCsBg}|iiƒD]}||i|ƒq~|iiƒdS(N(RRRARORRoR:(RRR((RRmbs1cCs<g}|iD]}||i|ƒq~|iiƒdS(N(RRRARRoR:(RRR((RRjes+cCs g|(dS(N(R(R((RRhhscCs(hd|i<d|i<d|itZdZeƒZd„Zed„Zd„Zd„ZRS(sgstores the original state of an object when the commit() method on the attribute manager is called.cCs:h|_x*|i|iƒD]}|i||ƒqWdS(N(RRARtmanaged_attributesRRsRbRQ(RRRRb((RRs cCso|tijo.|ii|iƒo|i|i}q>n|tij o|i|ƒ|i |it|ƒD]0}t||dƒ}t|t ƒo|Vq1q1WdS(sYreturns an iterator of all InstrumentedAttribute objects associated with the given class.s is not a typeN( Rktclass_ttypeR|tdirRRrRRR(RR¸RR((RR¬…s ccslt|tƒpt|ƒd‚nxAt|iƒD]0}t||dƒ}t|t ƒo|Vq4q4WdS(Ns is not a type( RkR¸R¹R|R›R<RRrRRR(RR¸RR((Rtnoninherited_managed_attributesŽscCsHx2|i|iƒD]}|i|ƒotSqqW|iidt ƒS(NR%( RR¬R`RsRbR,R'R*RR+(RR`Rb((RR)–s  cCst|d|iihƒdS(ssets up the __sa_attr_state dictionary on the given instance. This dictionary is automatically created when the '_state' attribute of the class is first accessed, but calling it here will save a single throw of an AttributeError that occurs in that creation step.s_%s__sa_attr_stateN(tsetattrRRsR](RR((Rt init_attrœscKst|i|ƒi||S(sRreturns a new AttributeHistory object for the given attribute on the given object.N(RrRRsRR&R(RRRR((RR&¢scCs\t|i|ƒ}|i|d|ƒ}|ti jogSn|i o|Sn|gSdS(s[returns an attribute of the given name from the given object. if the attribute is a scalar, returns it as a single-item list, otherwise returns the list based attribute. if the attribute's value is to be produced by an unexecuted callable, the callable will only be executed if the given 'passive' flag is False. R$N( RrRRsRRbRR$RRR4R (RRRR$RbR((Rt get_as_list¦s cCsB|i|ƒy|id=Wntj onX||id