ó
TR¹Nc           @   sÖ   d  Z  d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ	 d Z
 d e f d „  ƒ  YZ d S(   s   Global Django exceptionst   ObjectDoesNotExistc           B   s   e  Z d  Z e Z RS(   s#   The requested object does not exist(   t   __name__t
   __module__t   __doc__t   Truet   silent_variable_failure(    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyR       s   t   MultipleObjectsReturnedc           B   s   e  Z d  Z RS(   s?   The query returned multiple objects when only one was expected.(   R   R   R   (    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyR      s   t   SuspiciousOperationc           B   s   e  Z d  Z RS(   s!   The user did something suspicious(   R   R   R   (    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyR      s   t   PermissionDeniedc           B   s   e  Z d  Z RS(   s+   The user did not have permission to do that(   R   R   R   (    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyR      s   t   ViewDoesNotExistc           B   s   e  Z d  Z RS(   s!   The requested view does not exist(   R   R   R   (    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyR	      s   t   MiddlewareNotUsedc           B   s   e  Z d  Z RS(   s8   This middleware is not used in this server configuration(   R   R   R   (    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyR
      s   t   ImproperlyConfiguredc           B   s   e  Z d  Z RS(   s'   Django is somehow improperly configured(   R   R   R   (    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyR      s   t
   FieldErrorc           B   s   e  Z d  Z RS(   s(   Some kind of problem with a model field.(   R   R   R   (    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyR      s   t   __all__t   ValidationErrorc           B   s8   e  Z d  Z d d d „ Z d „  Z d „  Z d „  Z RS(   s   An error while validating data.c         C   s±   d d  l  } d d l m } t | t ƒ rO | |  _ t | j | j ƒ  ƒ } n  t | t	 ƒ rƒ g  | D] } | | ƒ ^ qe |  _
 n* | |  _ | |  _ | | ƒ } | g |  _
 d  S(   Niÿÿÿÿ(   t   force_unicode(   t   operatort   django.utils.encodingR   t
   isinstancet   dictt   message_dictt   reducet   addt   valuest   listt   messagest   codet   params(   t   selft   messageR   R   R   R   t   msg(    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyt   __init__&   s    	%		c         C   s)   t  |  d ƒ r t |  j ƒ St |  j ƒ S(   NR   (   t   hasattrt   reprR   R   (   R   (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyt   __str__:   s    c         C   s1   t  |  d ƒ r  d t |  j ƒ Sd t |  j ƒ S(   NR   s   ValidationError(%s)(   R    R!   R   R   (   R   (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyt   __repr__C   s    c         C   sn   t  |  d ƒ r] | rQ xB |  j j ƒ  D]% \ } } | j | g  ƒ j | ƒ q% Wqj |  j } n |  j | t <| S(   NR   (   R    R   t   itemst
   setdefaultt   extendR   t   NON_FIELD_ERRORS(   R   t
   error_dictt   kt   v(    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyt   update_error_dictH   s     N(   R   R   R   t   NoneR   R"   R#   R+   (    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyR   $   s
   			N(   R   t	   ExceptionR    R   R   R   R	   R
   R   R   R'   R   (    (    (    sC   /home/panlixing/Python_Projects/gaeseries/django/core/exceptions.pyt   <module>   s   