ó
H`¾Tc           @   s`  d  Z  d d l m Z m Z e e f Z d e j f d „  ƒ  YZ	 e	 Z
 d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d	 e j f d
 „  ƒ  YZ d e j f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d „  Z e j d ƒ d „  ƒ Z d S(   s   SQLAlchemy ORM exceptions.i   (   t   exct   utilt   StaleDataErrorc           B   s   e  Z d  Z RS(   s€  An operation encountered database state that is unaccounted for.

    Conditions which cause this to happen include:

    * A flush may have attempted to update or delete rows
      and an unexpected number of rows were matched during
      the UPDATE or DELETE statement.   Note that when
      version_id_col is used, rows in UPDATE or DELETE statements
      are also matched against the current known version
      identifier.

    * A mapped object with version_id_col was refreshed,
      and the version number coming back from the database does
      not match that of the object itself.

    * A object is detached from its parent object, however
      the object was previously attached to a different parent
      identity which was garbage collected, and a decision
      cannot be made if the new parent was really the most
      recent "parent".

      .. versionadded:: 0.7.4

    (   t   __name__t
   __module__t   __doc__(    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR      s   t
   FlushErrorc           B   s   e  Z d  Z RS(   s0   A invalid condition was detected during flush().(   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   ,   s   t   UnmappedErrorc           B   s   e  Z d  Z RS(   s?   Base for exceptions that involve expected mappings not present.(   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   0   s   t   ObjectDereferencedErrorc           B   s   e  Z d  Z RS(   sP   An operation cannot complete due to an object being garbage
    collected.

    (   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   4   s   t   DetachedInstanceErrorc           B   s   e  Z d  Z RS(   sS   An attempt to access unloaded attributes on a
    mapped instance that is detached.(   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR	   ;   s   t   UnmappedInstanceErrorc           B   s2   e  Z d  Z e j d ƒ d d „ ƒ Z d „  Z RS(   s;   An mapping operation was requested for an unknown instance.s   sqlalchemy.orm.basec         C   s¢   | sŽ y9 | j  t | ƒ ƒ t t | ƒ ƒ } d | | f } WqŽ t k
 rŠ t t | ƒ ƒ } t | t ƒ r‹ | d t | ƒ 7} q‹ qŽ Xn  t j |  | ƒ d  S(   Ns’   Class %r is mapped, but this instance lacks instrumentation.  This occurs when the instanceis created before sqlalchemy.orm.mapper(%s) was called.s;   ; was a class (%s) supplied where an instance was required?(   t   class_mappert   typet   _safe_cls_namet   UnmappedClassErrort   _default_unmappedt
   isinstanceR   t   __init__(   t   selft   baset   objt   msgt   name(    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   C   s    c         C   s   |  j  d  |  j d f f S(   Ni    (   t	   __class__t   Nonet   args(   R   (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyt
   __reduce__U   s    N(   R   R   R   R   t   dependenciesR   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR
   @   s   R   c           B   s#   e  Z d  Z d d „ Z d „  Z RS(   s8   An mapping operation was requested for an unknown class.c         C   s)   | s t  | ƒ } n  t j |  | ƒ d  S(   N(   R   R   R   (   R   t   clsR   (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   \   s    c         C   s   |  j  d  |  j d f f S(   Ni    (   R   R   R   (   R   (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   a   s    N(   R   R   R   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   Y   s   t   ObjectDeletedErrorc           B   s2   e  Z d  Z e j d ƒ d d „ ƒ Z d „  Z RS(   sé  A refresh operation failed to retrieve the database
    row corresponding to an object's known primary key identity.

    A refresh operation proceeds when an expired attribute is
    accessed on an object, or when :meth:`.Query.get` is
    used to retrieve an object which is, upon retrieval, detected
    as expired.   A SELECT is emitted for the target row
    based on primary key; if no row is returned, this
    exception is raised.

    The true meaning of this exception is simply that
    no row exists for the primary key identifier associated
    with a persistent object.   The row may have been
    deleted, or in some cases the primary key updated
    to a new value, outside of the ORM's management of the target
    object.

    s   sqlalchemy.orm.basec         C   s3   | s d | j  | ƒ } n  t j j |  | ƒ d  S(   NsD   Instance '%s' has been deleted, or its row is otherwise not present.(   t	   state_strt   sa_exct   InvalidRequestErrorR   (   R   R   t   stateR   (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   x   s    c         C   s   |  j  d  |  j d f f S(   Ni    (   R   R   R   (   R   (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   €   s    N(   R   R   R   R   R   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   e   s   t   UnmappedColumnErrorc           B   s   e  Z d  Z RS(   s5   Mapping operation was requested on an unknown column.(   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR"   „   s   t   NoResultFoundc           B   s   e  Z d  Z RS(   s2   A database result was required but none was found.(   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR#   ˆ   s   t   MultipleResultsFoundc           B   s   e  Z d  Z RS(   sC   A single database result was required but more than one were found.(   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR$   Œ   s   c         C   sd   y d j  |  j |  j f ƒ } Wn> t k
 r_ t |  d d  ƒ } | d  k r` t |  ƒ } q` n X| S(   Nt   .R   (   t   joinR   R   t   AttributeErrort   getattrR   t   repr(   R   t   cls_name(    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR      s    s   sqlalchemy.orm.basec         C   sd   y |  j  | ƒ j } Wn- t k
 r/ i  } n t k
 rE i  } n Xt | ƒ } | s` d | Sd  S(   Ns   Class '%s' is not mapped(   t   manager_of_classt   mapperst   NO_STATEt	   TypeErrorR   (   R   R   R,   R   (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyR   š   s    	
N(   R   t    R    R   R   R'   t   KeyErrorR-   t   SQLAlchemyErrorR   t   ConcurrentModificationErrorR   R    R   R   R	   R
   R   R   R"   R#   R$   R   R   R   (    (    (    sX   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/orm/exc.pyt   <module>   s    	
