/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/state.pyc (32294B)
 4]c@sTdZddlZddlmZddlmZddlmZddlmZddlmZdd lm Z dd lm Z dd lm Z dd lm Z dd lm Z ddlmZddlmZddlmZddlmZddlmZejdejfdYZdefdYZdefdYZdS(sDefines instrumentation of instances. This module is usually not directly visible to user applications, but defines a large part of the ORM's interactivity. iNi(tbase(texc(t interfaces(t ATTR_WAS_SET(tINIT_OK(t NEVER_SET(tNO_VALUE(tPASSIVE_NO_INITIALIZE(tPASSIVE_NO_RESULT(t PASSIVE_OFF(tSQL_OK(t PathRegistryi(t inspection(tutilt InstanceStatecBseZdZd0Zd0Zd0ZejZ d1Z d0Z d0Z e Ze Ze Ze Ze ZeZd0Zd2Zd3ZdZd0ZejdZedZedZedZedZ edZ!edZ"eej#d d Z$d Z%eej#d d Z&ed Z'edZ(edZ)ejdZ*ejdZ+ejdZ,edZ-e.e dZ/d0dZ0dZ1dZ2dZ3edZ4dZ5dZ6dZ7dZ8dZ9dZ:d Z;d!Z<e.d"Z=d#Z>e d$Z?d%Z@ed&ZAd'ZBed(ZCed)ZDed*ZEd+ZFe e d,ZGd-ZHd0d.ZIe.d0d/ZJRS(4stracks state information at the instance level. The :class:`.InstanceState` is a key object used by the SQLAlchemy ORM in order to track the state of an object; it is created the moment an object is instantiated, typically as a result of :term:`instrumentation` which SQLAlchemy applies to the ``__init__()`` method of the class. :class:`.InstanceState` is also a semi-public object, available for runtime inspection as to the state of a mapped instance, including information such as its current status within a particular :class:`.Session` and details about data on individual attributes. The public API in order to acquire a :class:`.InstanceState` object is to use the :func:`.inspect` system:: >>> from sqlalchemy import inspect >>> insp = inspect(some_mapped_object) .. seealso:: :ref:`core_inspection_toplevel` cCsF|j|_||_tj||j|_i|_t|_ dS(N( t __class__tclass_tmanagertweakreftreft_cleanuptobjtcommitted_statetsettexpired_attributes(tselfRR((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt__init__Ys    cs&tjtfdjDS(saReturn a namespace representing each attribute on the mapped object, including its current value and history. The returned object is an instance of :class:`.AttributeState`. This object allows inspection of the current data within an attribute as well as attribute history since the last flush. c3s$|]}|t|fVqdS(N(tAttributeState(t.0tkey(R(sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pys us(R tImmutablePropertiestdictR(R((RsG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pytattrshs cCs|jdko|j S(syReturn true if the object is :term:`transient`. .. seealso:: :ref:`session_object_states` N(RtNonet _attached(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt transientxs cCs|jdko|jS(sxReturn true if the object is :term:`pending`. .. seealso:: :ref:`session_object_states` N(RR!R"(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pytpendings cCs|jdk o|jo|jS(sReturn true if the object is :term:`deleted`. An object that is in the deleted state is guaranteed to not be within the :attr:`.Session.identity_map` of its parent :class:`.Session`; however if the session's transaction is rolled back, the object will be restored to the persistent state and the identity map. .. note:: The :attr:`.InstanceState.deleted` attribute refers to a specific state of the object that occurs between the "persistent" and "detached" states; once the object is :term:`detached`, the :attr:`.InstanceState.deleted` attribute **no longer returns True**; in order to detect that a state was deleted, regardless of whether or not the object is associated with a :class:`.Session`, use the :attr:`.InstanceState.was_deleted` accessor. .. versionadded: 1.1 .. seealso:: :ref:`session_object_states` N(RR!R"t_deleted(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pytdeletedscCs|jS(sReturn True if this object is or was previously in the "deleted" state and has not been reverted to persistent. This flag returns True once the object was deleted in flush. When the object is expunged from the session either explicitly or via transaction commit and enters the "detached" state, this flag will continue to report True. .. versionadded:: 1.1 - added a local method form of :func:`.orm.util.was_deleted`. .. seealso:: :attr:`.InstanceState.deleted` - refers to the "deleted" state :func:`.orm.util.was_deleted` - standalone function :ref:`session_object_states` (R%(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt was_deletedscCs |jdk o|jo|j S(s{Return true if the object is :term:`persistent`. An object that is in the persistent state is guaranteed to be within the :attr:`.Session.identity_map` of its parent :class:`.Session`. .. versionchanged:: 1.1 The :attr:`.InstanceState.persistent` accessor no longer returns True for an object that was "deleted" within a flush; use the :attr:`.InstanceState.deleted` accessor to detect this state. This allows the "persistent" state to guarantee membership in the identity map. .. seealso:: :ref:`session_object_states` N(RR!R"R%(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt persistentscCs|jdk o|j S(sxReturn true if the object is :term:`detached`. .. seealso:: :ref:`session_object_states` N(RR!R"(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pytdetacheds ssqlalchemy.orm.sessioncCs|jdk o|j|jkS(N(t session_idR!t _sessions(Rt sessionlib((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyR"scCs5||jkr1t|j|_t|j|sc Cs|jjpd}|jjp!d}|jjp3d}|jjpEd}xX|D]P}|j} |jdk} | ox| } d|_|r|jr|`n| r|r|dk r|j } | dk r||| qqq|dk r|j } | dk r||| qqnz| rY|dk rY|j } | dk r||| qn=| r|dk r|j } | dk r||| qnd|_ qOWdS(N( tdispatchtpersistent_to_detachedR!tdeleted_to_detachedtpending_to_transienttpersistent_to_transientR%RR*Rt _strong_obj( RtstatesR0t to_transientR:R;R<R=tstateR&R$R(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_detach_statesHs<              cCs0|rtj|g|nd|_|_dS(N(RRBR!R*R>(RR0((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_detachqscCs|j|`dS(N(RCR(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_disposews cCsXtdkrdS|j}|dk r>|j||`nd|_|_|`dS(sWeakref callback cleanup. This callable cleans out the state when it is being garbage collected. this _cleanup **assumes** that there are no strong refs to us! Will not work otherwise! N(RR!t_instance_dictt _fast_discardR*R>R(RRt instance_dict((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyR{s     cCsdS(N(R!(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyRscCs-|j}|dk r%tj|SiSdS(sReturn the instance dict used by the object. Under normal circumstances, this is always synonymous with the ``__dict__`` attribute of the mapped object, unless an alternative instrumentation system has been configured. In the case that the actual object has been garbage collected, this accessor returns a blank dictionary. N(RR!RRG(Rto((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyRs   cOs|d|d|d}}}|j}|jj|||y|j|d|SWn0tj|jj|||WdQXnXdS(Niii(RR9tinitt original_initR t safe_reraiset init_failure(tmixedtkwargsRtinstancetargsR((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_initialize_instances   cCs |j|jj||j|S(N(Rtimplt get_historyR(RRtpassive((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyRSscCs|j|jS(N(RRR(RR((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pytget_implscCs-||jkr"t|j|s RR5tmodifiedtexpiredt callablesRR4t load_optionsRRtinfot load_pathR( RR5RZR[R\RR4R]RRR^(RtupdateR_t serializeRt _serialize(Rt state_dict((RsG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt __getstate__s$   cCs||d}|dk r=tj||j|_|j|_nd|_|d|_|jdi|_|jdi|_ |jdi|_ |jdt |_ |jdt |_ d|kr|jj|dnd |krv|d |_y|d |_Wqtk rrt|_xKt|jD]6}|j||kr5|jj||j|=q5q5WqXn(d |kr|d |_n t|_|jjgdD]"}||kr|||f^q|jr?y|jd |_Wq?tk r;t|jd kst|jd|_d|_q?Xnd|krdtj|d|_n|d|||dS(NRORRR5R4RZR[R^R\RRR]iR_R(RR](N(R!RRRRRRtgetRR5R4tFalseRZR[R^R`R\RtKeyErrorRtlisttaddRXRtidentity_tokent IndexErrortlentAssertionErrorR t deserializeR_(RRctinstRY((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt __setstate__sP             #   cCs~|j|d}|dk rK|j|jjrK|j|jj|n|jj||jrz|jj|dndS(sKRemove the given attribute and any callables associated with it.N( tpopR!RRRt collectiont_invalidate_collectionRtdiscardR\(Rtdict_Rtold((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_resets  cCs(d|jkr$t|j|_ndS(NR\(RXRR\(Rtfrom_((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_copy_callables%scsD|jjr.fd}nfd}|S(NcsZd|jkri|_n|jd}|dk rIj|n|jas(tTrueR[RZRtRtclearRfR!R>RXRR`Rt_scalar_loader_implstexpire_missingRR\t intersectiont_collection_impl_keysRqt _sa_adaptert invalidatedR-t _all_key_setR9texpire(RRut modified_setRRRYRrR((RusG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_expire?s4         (    c CsI|jjdd}|j}x|D]}|j|j}|jr|re|js%||kreq%n|jj ||r||kr||=qn|j |t }|j r|t k r|j |n|jr||jkr|t k r||j|s(RRR(R((RsG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pytunloaded_expirables  cs#jjfdjDS(Nc3s(|]}j|jjr|VqdS(N(RRRR(RR(R(sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pys s(RRR(R((RsG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_unloaded_non_objects  cCsdS(N(R!(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyREscCs|r|jsdS|rA|j|krAtjd|jn|j|jksY|r|r|tkr|j|kr||j}qn|dttfkr|j|}qn||j|jRZRREt _modifiedRiRtorm_exctObjectDereferencedErrorRRtstate_class_str(RRuRtpreviousRrt is_userlandRGRo((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_modified_events:  "     cCsx!|D]}|jj|dqWt|_|jjt|j||j rx6t|j j|j|D]}|j |=qwWndS(s8Commit attributes. This is used by a partial-attribute load operation to mark committed those attributes which were refreshed from the database. Attributes marked as "expired" can potentially remain "expired" after this step if a value was not populated in state.dict. N( RRqR!RfR[Rtdifference_updateRRR\(RRuRR((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt_commits    %cCs|j||fg|dS(sScommit all attributes unconditionally. This is used after a flush() or a full load/refresh to remove all pending state from the instance. - all attributes are marked as "committed" - the "strong dirty reference" is removed - the "modified" flag is set to False - any "expired" markers for scalar attributes loaded are removed. - lazy load callables for objects / collections *stay* Attributes marked as "expired" can potentially remain "expired" after this step if a value was not populated in state.dict. N(t_commit_all_states(RRuRG((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt _commit_all scCsx|D]\}}|j}|jjd|kr?|d=n|jj||rq|jrq|jj|nt|_|_ d|_ qWdS(s.Mass / highly inlined version of commit_all().R5N( RXRRRRRZRRtRfR[R!R>(Rtiter_RGRARuRc((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyR2s    N((((Kt__name__t __module__t__doc__R!R*RtrunidR t EMPTY_SETR]R_t insert_orderR>RfRZR[R%t _load_pendingt_orphaned_outside_of_sessionRt is_instanceRjR-R\RRtmemoized_propertyR tpropertyR#R$R&R'R(R)t dependenciesR"R.R0R1R2R3R4R5R6R8t classmethodRBRCRDRRRRQRSRURWRdRpRwRyR~RRRRRRRRRERRRR(((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyR"s       (         :  *    .  RcBsMeZdZdZedZedZedZdZRS(sProvide an inspection interface corresponding to a particular attribute on a particular mapped object. The :class:`.AttributeState` object is accessed via the :attr:`.InstanceState.attrs` collection of a particular :class:`.InstanceState`:: from sqlalchemy import inspect insp = inspect(some_mapped_object) attr_state = insp.attrs.some_attribute cCs||_||_dS(N(RAR(RRAR((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyRVs cCs|jjj|jtS(sThe current value of this attribute as loaded from the database. If the value has not been loaded, or is otherwise not present in the object's dictionary, returns NO_VALUE. (RARReRR(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt loaded_valueZscCs,|jj|jj|jj|jjS(sReturn the value of this attribute. This operation is equivalent to accessing the object's attribute directly or via ``getattr()``, and will fire off any pending loader callables if needed. (RARRt__get__RR(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pytvalueds cCs|jj|jtS(sXReturn the current **pre-flush** change history for this attribute, via the :class:`.History` interface. This method will **not** emit loader callables if the value of the attribute is unloaded. .. note:: The attribute history system tracks changes on a **per flush basis**. Each time the :class:`.Session` is flushed, the history of each attribute is reset to empty. The :class:`.Session` by default autoflushes each time a :class:`.Query` is invoked. For options on how to control this, see :ref:`session_flushing`. .. seealso:: :meth:`.AttributeState.load_history` - retrieve history using loader callables if the value is not locally present. :func:`.attributes.get_history` - underlying function (RARSRR(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pythistoryqscCs|jj|jttAS(sReturn the current **pre-flush** change history for this attribute, via the :class:`.History` interface. This method **will** emit loader callables if the value of the attribute is unloaded. .. note:: The attribute history system tracks changes on a **per flush basis**. Each time the :class:`.Session` is flushed, the history of each attribute is reset to empty. The :class:`.Session` by default autoflushes each time a :class:`.Query` is invoked. For options on how to control this, see :ref:`session_flushing`. .. seealso:: :attr:`.AttributeState.history` :func:`.attributes.get_history` - underlying function .. versionadded:: 0.9.0 (RARSRR R(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt load_historys( RRRRRRRRR(((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyRGs     RVcBs)eZdZdZdZdZRS(sA writable placeholder for an unloaded collection. Stores items appended to and removed from a collection that has not yet been loaded. When the collection is loaded, the changes stored in PendingCollection are applied to it to produce the final result. cCs"tj|_tj|_dS(N(R t IdentitySett deleted_itemstOrderedIdentitySett added_items(R((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyRscCs6||jkr"|jj|n|jj|dS(N(RtremoveRRi(RR((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pytappendscCs6||jkr"|jj|n|jj|dS(N(RRRRi(RR((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyRs(RRRRRR(((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyRVs  (RRtRRRRRRRRRRR R t path_registryR RR R t_self_inspectstInspectionAttrInfoRR1RRV(((sG/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/state.pyt s.  '`