ó
®â0_c           @   sÒ  d  Z  d d l m Z d d l m 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 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$ e f d% „  ƒ  YZ d& Z d' e f d( „  ƒ  YZ d) e f d* „  ƒ  YZ d+ S(,   s.   
Global Django exception and warning classes.
iÿÿÿÿ(   t   six(   t
   force_textt   FieldDoesNotExistc           B   s   e  Z d  Z RS(   s(   The requested model field does not exist(   t   __name__t
   __module__t   __doc__(    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR      s   t   DjangoRuntimeWarningc           B   s   e  Z RS(    (   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR      s   t   AppRegistryNotReadyc           B   s   e  Z d  Z RS(   s-   The django.apps registry is not populated yet(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR      s   t   ObjectDoesNotExistc           B   s   e  Z d  Z e Z RS(   s#   The requested object does not exist(   R   R   R   t   Truet   silent_variable_failure(    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/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   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR      s   t   SuspiciousOperationc           B   s   e  Z d  Z RS(   s!   The user did something suspicious(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR       s   t   SuspiciousMultipartFormc           B   s   e  Z d  Z RS(   s+   Suspect MIME request in multipart form data(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   $   s   t   SuspiciousFileOperationc           B   s   e  Z d  Z RS(   s/   A Suspicious filesystem operation was attempted(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   )   s   t   DisallowedHostc           B   s   e  Z d  Z RS(   s'   HTTP_HOST header contains invalid value(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   .   s   t   DisallowedRedirectc           B   s   e  Z d  Z RS(   s&   Redirect to scheme not in allowed list(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   3   s   t   TooManyFieldsSentc           B   s   e  Z d  Z RS(   sl   
    The number of fields in a GET or POST request exceeded
    settings.DATA_UPLOAD_MAX_NUMBER_FIELDS.
    (   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   8   s   t   RequestDataTooBigc           B   s   e  Z d  Z RS(   sq   
    The size of the request (excluding any file uploads) exceeded
    settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
    (   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/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   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   H   s   t   ViewDoesNotExistc           B   s   e  Z d  Z RS(   s!   The requested view does not exist(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   M   s   t   MiddlewareNotUsedc           B   s   e  Z d  Z RS(   s8   This middleware is not used in this server configuration(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   R   s   t   ImproperlyConfiguredc           B   s   e  Z d  Z RS(   s'   Django is somehow improperly configured(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   W   s   t
   FieldErrorc           B   s   e  Z d  Z RS(   s(   Some kind of problem with a model field.(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   \   s   t   __all__t   ValidationErrorc           B   s_   e  Z d  Z d d d „ Z e d „  ƒ Z e d „  ƒ Z d „  Z d „  Z	 d „  Z
 d „  Z RS(	   s   An error while validating data.c         C   s²  t  t |  ƒ j | | | ƒ t | t ƒ r t | d ƒ rF | j } q t | t j r[ d n d ƒ sp | j } q | j	 | j
 | j } } } n  t | t ƒ rö i  |  _ x| j ƒ  D]: \ } } t | t ƒ sß t | ƒ } n  | j |  j | <qµ Wn¸ t | t ƒ r‡g  |  _ x | D]k } t | t ƒ s9t | ƒ } n  t | d ƒ rm|  j j t | j j ƒ  g  ƒ ƒ q|  j j | j ƒ qWn' | |  _	 | |  _
 | |  _ |  g |  _ d S(   sÒ  
        The `message` argument can be a single error, a list of errors, or a
        dictionary that maps field names to lists of errors. What we define as
        an "error" can be either a simple string or an instance of
        ValidationError with its message attribute set, and what we define as
        list or dictionary can be an actual `list` or `dict` or an instance
        of ValidationError with its `error_list` or `error_dict` attribute set.
        t
   error_dictt   messaget   codeN(   t   superR   t   __init__t
   isinstancet   hasattrR   R    t   PY3t
   error_listR   R   t   paramst   dictt   itemst   listt   extendt   sumt   values(   t   selfR   R   R#   t   fieldt   messages(    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   f   s2     		%			c         C   s   t  |  d ƒ t |  ƒ S(   NR   (   t   getattrR$   (   R*   (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyt   message_dict–   s    c         C   s2   t  |  d ƒ r( t t |  ƒ j ƒ  g  ƒ St |  ƒ S(   NR   (   R    R(   R$   R)   R&   (   R*   (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR,   ž   s    c         C   sk   t  |  d ƒ rK xU |  j j ƒ  D]% \ } } | j | g  ƒ j | ƒ q Wn | j t g  ƒ j |  j ƒ | S(   NR   (   R    R   R%   t
   setdefaultR'   t   NON_FIELD_ERRORSR"   (   R*   R   R+   R"   (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyt   update_error_dict¤   s
     c         c   sŽ   t  |  d ƒ rI xx |  j j ƒ  D]# \ } } | t t | ƒ ƒ f Vq WnA x> |  j D]3 } | j } | j r{ | | j ;} n  t | ƒ VqS Wd  S(   NR   (	   R    R   R%   R&   R   R"   R   R#   R   (   R*   R+   t   errorst   errorR   (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyt   __iter__¬   s    		c         C   s/   t  |  d ƒ r t t |  ƒ ƒ St t |  ƒ ƒ S(   NR   (   R    t   reprR$   R&   (   R*   (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyt   __str__·   s    c         C   s   d |  S(   Ns   ValidationError(%s)(    (   R*   (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyt   __repr__¼   s    N(   R   R   R   t   NoneR   t   propertyR.   R,   R1   R4   R6   R7   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR   d   s   0			t   EmptyResultSetc           B   s   e  Z d  Z RS(   s)   A database query predicate is impossible.(   R   R   R   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyR:   À   s   N(   R   t   django.utilsR    t   django.utils.encodingR   t	   ExceptionR   t   RuntimeWarningR   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R0   R   R:   (    (    (    s8   /tmp/pip-unpacked-wheel-BAJOf3/django/core/exceptions.pyt   <module>   s,   \