ó
H`¾Tc           @   sÛ   d  Z  d d l Z d d l m Z d d l m Z m Z d d l m Z d d l	 m
 Z
 m Z m Z m Z m Z m Z m Z m Z d d	 l m	 Z	 d
 e j f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d S(   sŸ   Defines instrumentation of instances.

This module is usually not directly visible to user applications, but
defines a large part of the ORM's interactivity.

iÿÿÿÿNi   (   t   utili   (   t   exct
   interfaces(   t   PathRegistry(   t   PASSIVE_NO_RESULTt   SQL_OKt	   NEVER_SETt   ATTR_WAS_SETt   NO_VALUEt   PASSIVE_NO_INITIALIZEt   INIT_OKt   PASSIVE_OFF(   t   baset   InstanceStatec           B   s  e  Z d  Z d- Z d- Z d- Z e j Z	 d. Z
 d- Z d- Z e Z e Z e Z e Z e Z d „  Z e j d „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z e e j d ƒ d „  ƒ ƒ Z e e j d ƒ d	 „  ƒ ƒ Z e d
 „  ƒ Z e d „  ƒ Z  e d „  ƒ Z! e j d „  ƒ Z" e j d „  ƒ Z# e j d „  ƒ Z$ e d „  ƒ Z% d „  Z& d „  Z' d „  Z( d „  Z) e d „  ƒ Z* d „  Z+ d „  Z, d „  Z- d „  Z. d „  Z/ d „  Z0 d „  Z1 d „  Z2 d „  Z3 e4 d „  ƒ Z5 d  „  Z6 d! „  Z7 d" „  Z8 e d# „  ƒ Z9 d$ „  Z: e d% „  ƒ Z; e d& „  ƒ Z< e d' „  ƒ Z= d( „  Z> e e d) „ Z? d* „  Z@ d- d+ „ ZA e4 d- d, „ ƒ ZB RS(/   s‰  tracks 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`

    c         C   sC   | j  |  _ | |  _ t j | |  j ƒ |  _ i  |  _ i  |  _ d  S(   N(	   t	   __class__t   class_t   managert   weakreft   reft   _cleanupt   objt	   callablest   committed_state(   t   selfR   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   __init__@   s
    		c            s&   t  j t ‡  f d †  ˆ  j Dƒ ƒ ƒ S(   sa  Return 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.

        c         3   s$   |  ] } | t  ˆ  | ƒ f Vq d  S(   N(   t   AttributeState(   t   .0t   key(   R   (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pys	   <genexpr>U   s   (   R    t   ImmutablePropertiest   dictR   (   R   (    (   R   sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   attrsG   s    c         C   s   |  j  d k o |  j S(   sy   Return true if the object is :term:`transient`.

        .. seealso::

            :ref:`session_object_states`

        N(   R   t   Nonet	   _attached(   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt	   transientZ   s    	c         C   s   |  j  d k o |  j S(   sx   Return true if the object is :term:`pending`.


        .. seealso::

            :ref:`session_object_states`

        N(   R   R   R    (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   pendingf   s    
c         C   s   |  j  d k	 o |  j S(   s~   Return true if the object is :term:`persistent`.

        .. seealso::

            :ref:`session_object_states`

            N(   R   R   R    (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt
   persistents   s    	c         C   s   |  j  d k	 o |  j S(   sx   Return true if the object is :term:`detached`.

        .. seealso::

            :ref:`session_object_states`

        N(   R   R   R    (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   detached   s    	s   sqlalchemy.orm.sessionc         C   s   |  j  d  k	 o |  j  | j k S(   N(   t
   session_idR   t	   _sessions(   R   t
   sessionlib(    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR    ‹   s    c         C   s   | j  |  ƒ S(   s]   Return the owning :class:`.Session` for this instance,
        or ``None`` if none available.(   t   _state_session(   R   R'   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   session‘   s    c         C   s
   |  j  ƒ  S(   sM   Return the mapped object represented by this
        :class:`.InstanceState`.(   R   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   object˜   s    c         C   s"   |  j  d k r d S|  j  d Sd S(   sÖ  Return the mapped identity of the mapped object.
        This is the primary key identity as persisted by the ORM
        which can always be passed directly to
        :meth:`.Query.get`.

        Returns ``None`` if the object has no primary key identity.

        .. note::
            An object which is transient or pending
            does **not** have a mapped identity until it is flushed,
            even if its attributes include primary key values.

        i   N(   R   R   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   identityž   s    c         C   s   |  j  S(   sõ   Return the identity key for the mapped object.

        This is the key used to locate the object within
        the :attr:`.Session.identity_map` mapping.   It contains
        the identity as returned by :attr:`.identity` within it.


        (   R   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   identity_key²   s    c         C   s   i  S(   N(    (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   parentsÀ   s    c         C   s   i  S(   N(    (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _pending_mutationsÄ   s    c         C   s
   |  j  j S(   s8   Return the :class:`.Mapper` used for this mapepd object.(   R   t   mapper(   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR/   È   s    c         C   s   t  |  j ƒ S(   s¯   Return ``True`` if this object has an identity key.

        This should always have the same value as the
        expression ``state.persistent or state.detached``.

        (   t   boolR   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   has_identityÍ   s    c         C   s   d  |  _ |  _ d  S(   N(   R   R%   t   _strong_obj(   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _detach×   s    c         C   s   |  j  ƒ  |  ` d  S(   N(   R3   R   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _disposeÚ   s    
c         C   sE   |  j  ƒ  } | r" | j |  ƒ n  i  |  _ d  |  _ |  _ |  ` d  S(   N(   t   _instance_dictt   discardR   R   R%   R2   R   (   R   R   t   instance_dict(    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR   Þ   s    	c         C   s   d  S(   N(   R   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR   ç   s    c         C   s-   |  j  ƒ  } | d k	 r% t j | ƒ Si  Sd S(   s  Return 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(   R   R   R   R7   (   R   t   o(    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR   ê   s    c          O   s~   |  d |  d |  d } } } | j  } | j j | | | ƒ y | j |  d | Ž  SWn  | j j | | | ƒ ‚  n Xd  S(   Ni    i   i   (   R   t   dispatcht   initt   original_initt   init_failure(   t   mixedt   kwargsR   t   instancet   argsR   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _initialize_instanceý   s     	c         C   s    |  j  | j j |  |  j | ƒ S(   N(   R   t   implt   get_historyR   (   R   R   t   passive(    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyRC   	  s    c         C   s   |  j  | j S(   N(   R   RB   (   R   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   get_impl  s    c         C   s-   | |  j  k r" t ƒ  |  j  | <n  |  j  | S(   N(   R.   t   PendingCollection(   R   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _get_pending_mutation  s    c            sl   i ˆ  j  ƒ  d 6} | j ‡  f d †  d Dƒ ƒ ˆ  j rO ˆ  j j ƒ  | d <n  ˆ  j j ˆ  | ƒ | d <| S(   NR?   c         3   s1   |  ]' } | ˆ  j  k r | ˆ  j  | f Vq d  S(   N(   t   __dict__(   R   t   k(   R   (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pys	   <genexpr>  s    R   R.   t   modifiedt   expiredR   R   R-   t   load_optionsR   t	   load_pathR   (	   s   committed_states   _pending_mutationss   modifieds   expireds	   callabless   keys   parentss   load_optionss   class_(   R   t   updateRM   t	   serializeR   t
   _serialize(   R   t
   state_dict(    (   R   sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   __getstate__  s      	c         C   sG  | d } | d  k	 r= t j | |  j ƒ |  _ | j |  _ n d  |  _ | d |  _ | j d i  ƒ |  _ | j d i  ƒ |  _	 | j d i  ƒ |  _
 | j d t ƒ |  _ | j d t ƒ |  _ | j d i  ƒ |  _ |  j j g  d D]" } | | k rá | | | f ^ qá ƒ d | k r/t j | d ƒ |  _ n  | d |  | | ƒ d  S(   NR?   R   R   R.   R-   RJ   RK   R   R   RL   RM   R   (   s   keys   load_options(   R   R   R   R   R   R   R   t   getR   R.   R-   t   FalseRJ   RK   R   RH   RN   R   t   deserializeRM   (   R   RQ   t   instRI   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   __setstate__$  s(    
		
#c         C   s#   |  j  j | ƒ j |  |  j ƒ d S(   sa   Set this attribute to an empty value or collection,
           based on the AttributeImpl in use.N(   R   RE   t
   initializeR   (   R   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _initializeC  s    c         C   sb   | j  | d ƒ } | d k	 rK |  j | j j rK |  j | j j | ƒ n  |  j j  | d ƒ d S(   sK   Remove the given attribute and any
           callables associated with it.N(   t   popR   R   RB   t
   collectiont   _invalidate_collectionR   (   R   t   dict_R   t   old(    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _resetI  s    c         C   s!   | j  | d ƒ |  |  j | <d S(   sI  a fast expire that can be called by column loaders during a load.

        The additional bookkeeping is finished up in commit_all().

        Should only be called for scalar attributes.

        This method is actually called a lot with joined-table
        loading, when the second table isn't present in the result.

        N(   RZ   R   R   (   R   R]   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _expire_attribute_pre_commitR  s    c            sD   | ˆ j  ‰ ˆ j r. ‡  ‡ ‡ f d †  } n ‡  ‡ f d †  } | S(   Nc            s?   | j  ˆ d  ƒ } | d  k	 r. ˆ j | ƒ n  ˆ  |  j ˆ <d  S(   N(   RZ   R   R\   R   (   t   stateR]   t   rowR^   (   t   fnR   RB   (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _set_callabled  s    c            s   ˆ  |  j  ˆ <d  S(   N(   R   (   Ra   R]   Rb   (   Rc   R   (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyRd   j  s    (   RB   R[   (   t   clsR   Rc   R   Rd   (    (   Rc   R   RB   sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _row_processor`  s
    	c         C   s  t  |  _ |  j r" | j |  ƒ n  t |  _ d  |  _ |  j j ƒ  t	 j
 j |  ƒ t	 j j |  ƒ x† |  j D]{ } |  j | j } | j r¯ | j sŸ | | k r¯ |  |  j | <n  | j | d  ƒ } | j rk | d  k	 rk | j | ƒ qk qk W|  j j j |  d  ƒ d  S(   N(   t   TrueRK   RJ   R6   RT   R   R2   R   t   clearR   R.   R_   R-   R   RB   t   accepts_scalar_loadert   expire_missingR   RZ   R[   R\   R9   t   expire(   R   R]   t   modified_setR   RB   R^   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _expiren  s"    					c         C   sÌ   |  j  j d d  ƒ } xš | D]’ } |  j | j } | j rK |  |  j | <n  | j | d  ƒ } | j r‚ | d  k	 r‚ | j	 | ƒ n  |  j
 j | d  ƒ | r | j | d  ƒ q q W|  j j j |  | ƒ d  S(   NR.   (   RH   RS   R   R   RB   Ri   R   RZ   R[   R\   R   R9   Rk   (   R   R]   t   attribute_namesR"   R   RB   R^   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _expire_attributesŠ  s    	c         C   sa   | t  @s t S|  j j |  j ƒ } |  j j |  | ƒ x$ | j |  j ƒ D] } |  j | =qI Wt S(   s¡   __call__ allows the InstanceState to act as a deferred
        callable for loading expired attributes, which is also
        serializable (picklable).

        (	   R   R   t   expired_attributest   intersectiont
   unmodifiedR   t   deferred_scalar_loaderR   R   (   R   Ra   RD   t   toloadRI   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   __call__›  s    
	c         C   s   t  |  j ƒ j |  j ƒ S(   s8   Return the set of keys which have no uncommitted changes(   t   setR   t
   differenceR   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyRr   ³  s    c         C   s"   t  | ƒ j |  j ƒ j |  j ƒ S(   s*   Return self.unmodified.intersection(keys).(   Rv   Rq   R   Rw   R   (   R   t   keys(    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   unmodified_intersection¹  s    c         C   s%   t  |  j ƒ j |  j ƒ j |  j ƒ S(   s²   Return the set of keys which do not have a loaded value.

        This includes expired attributes and any other attribute that
        was never populated or modified.

        (   Rv   R   Rw   R   R   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   unloaded¿  s    c            s#   ˆ  j  j ‡  f d †  ˆ  j Dƒ ƒ S(   Nc         3   s(   |  ] } ˆ  j  | j j r | Vq d  S(   N(   R   RB   Ri   (   R   t   attr(   R   (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pys	   <genexpr>Î  s    (   Rz   Rq   R   (   R   (    (   R   sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _unloaded_non_objectË  s    	c         C   s8   t  g  |  j j ƒ  D] \ } } | |  k r | ^ q ƒ S(   s"  Return the set of keys which are 'expired' to be loaded by
           the manager's deferred scalar loader, assuming no pending
           changes.

           see also the ``unmodified`` collection which is intersected
           against this set when a refresh operation occurs.

        (   Rv   R   t   items(   R   RI   t   v(    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyRp   Ò  s    
c         C   s   d  S(   N(   R   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR5   Þ  s    c         C   sI  | j  s d  S| j |  j k s% | r– | rƒ | t k rY | j | k rY | | j } qY n  | d  t t f k rƒ | j | ƒ } qƒ n  | |  j | j <n  |  j r® |  j d  k s¸ |  j	 rE|  j
 ƒ  } | rÝ | j j |  ƒ n  |  j ƒ  } |  j rþ | |  _ n  | d  k r9t j d |  j | j t j |  ƒ f ƒ ‚ n  t |  _	 n  d  S(   Nsa   Can't emit change event for attribute '%s' - parent object of type %s has been garbage collected.(   t   send_modified_eventsR   R   R   R   R   t   copyR%   R2   RJ   R5   t	   _modifiedt   addR   t   orm_exct   ObjectDereferencedErrorR   R   t   state_class_strRg   (   R   R]   R{   t   previousR[   t   forceR7   RV   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _modified_eventá  s0    	
	c         C   sg   x! | D] } |  j  j | d ƒ q Wt |  _ x3 t |  j ƒ j | ƒ j | ƒ D] } |  j | =qO Wd S(   s8  Commit 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(   R   RZ   R   RT   RK   Rv   R   Rq   (   R   R]   Rx   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _commit
  s    
		c         C   s   |  j  |  | f g | ƒ d S(   s  commit 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/callables for attributes loaded are removed.

        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(   R   R]   R7   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   _commit_all  s    c         C   s¹   x² | D]ª \ } } | j  j ƒ  t j j | ƒ | j } x: t | ƒ D], } | | k rF | | | k rF | | =qF qF W| r˜ | j r˜ | j j	 | ƒ n  t
 | _ | _ d | _ q Wd S(   s   Mass version of commit_all().N(   R   Rh   R   R.   R_   R   t   listRJ   R   R6   RT   RK   R   R2   (   R   t   iterR7   Ra   R]   R   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyRŠ   /  s    	N(    (C   t   __name__t
   __module__t   __doc__R   R%   R   t   runidR    t	   EMPTY_SETRL   RM   t   insert_orderR2   RT   RJ   RK   t   deletedt   _load_pendingRg   t   is_instanceR   t   memoized_propertyR   t   propertyR!   R"   R#   R$   t   dependenciesR    R)   R*   R+   R,   R-   R.   R/   R1   R3   R4   R   R   R   RA   RC   RE   RG   RR   RW   RY   R_   R`   t   classmethodRf   Rm   Ro   Ru   Rr   Ry   Rz   R|   Rp   R5   Rˆ   R‰   R‹   RŠ   (    (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR      sv   		
																				(	R   c           B   sM   e  Z d  Z d „  Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z d „  Z RS(   sŠ  Provide 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

    c         C   s   | |  _  | |  _ d  S(   N(   Ra   R   (   R   Ra   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR   R  s    	c         C   s   |  j  j j |  j t ƒ S(   sÇ   The 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.

        (   Ra   R   RS   R   R   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   loaded_valueV  s    c         C   s,   |  j  j |  j j |  j  j ƒ  |  j  j ƒ S(   sà   Return 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.

        (   Ra   R   R   t   __get__R   R   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   value`  s    	c         C   s   |  j  j |  j t ƒ S(   sÇ  Return 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.

        .. seealso::

            :meth:`.AttributeState.load_history` - retrieve history
            using loader callables if the value is not locally present.

            :func:`.attributes.get_history` - underlying function

        (   Ra   RC   R   R	   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   historyl  s    c         C   s   |  j  j |  j t t Aƒ S(   s„  Return 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.

        .. seealso::

            :attr:`.AttributeState.history`

            :func:`.attributes.get_history` - underlying function

        .. versionadded:: 0.9.0

        (   Ra   RC   R   R   R
   (   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   load_history  s    (	   RŽ   R   R   R   R˜   R›   R   Rž   RŸ   (    (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR   C  s   	
RF   c           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s  A 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.

    c         C   s"   t  j ƒ  |  _ t  j ƒ  |  _ d  S(   N(   R    t   IdentitySett   deleted_itemst   OrderedIdentitySett   added_items(   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR   œ  s    c         C   s6   | |  j  k r" |  j  j | ƒ n |  j j | ƒ d  S(   N(   R¡   t   removeR£   R‚   (   R   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   append   s    c         C   s6   | |  j  k r" |  j  j | ƒ n |  j j | ƒ d  S(   N(   R£   R¤   R¡   R‚   (   R   R   (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyR¤   ¦  s    (   RŽ   R   R   R   R¥   R¤   (    (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyRF   “  s   		(   R   R   t    R    R   Rƒ   R   t   path_registryR   R   R   R   R   R   R   R	   R
   R   t   _InspectionAttrR   R*   R   RF   (    (    (    sZ   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/state.pyt   <module>   s   :ÿ ÿ -P