
    g                        d Z ddlZddlmZ  G d de      Z G d de      Z G d d	e      Z G d
 de      Z G d de      Z	 G d de	      Z
 G d de	      Z G d de	      Z G d de	      Z G d de	      Z G d de	      Z G d de	      Z G d de      Z G d de      Z G d  d!e      Z G d" d#e      Z G d$ d%e      Z G d& d'e      Z G d( d)e      Zd*Z G d+ d,e      Z G d- d.e      Z G d/ d0e      Z G d1 d2e      Zy)3z.
Global Django exception and warning classes.
    N)make_hashablec                       e Zd ZdZy)FieldDoesNotExistz(The requested model field does not existN__name__
__module____qualname____doc__     n/var/www/python.vincentserveurtest.ovh/public_html/venv/lib/python3.12/site-packages/django/core/exceptions.pyr   r   
       2r   r   c                       e Zd ZdZy)AppRegistryNotReadyz-The django.apps registry is not populated yetNr   r   r   r   r   r      s    7r   r   c                       e Zd ZdZdZy)ObjectDoesNotExistz#The requested object does not existTN)r   r   r	   r
   silent_variable_failurer   r   r   r   r      s    -"r   r   c                       e Zd ZdZy)MultipleObjectsReturnedz?The query returned multiple objects when only one was expected.Nr   r   r   r   r   r      s    Ir   r   c                       e Zd ZdZy)SuspiciousOperationz!The user did something suspiciousNr   r   r   r   r   r   "   s    +r   r   c                       e Zd ZdZy)SuspiciousMultipartFormz+Suspect MIME request in multipart form dataNr   r   r   r   r   r   &       5r   r   c                       e Zd ZdZy)SuspiciousFileOperationz/A Suspicious filesystem operation was attemptedNr   r   r   r   r   r   ,   s    9r   r   c                       e Zd ZdZy)DisallowedHostz'HTTP_HOST header contains invalid valueNr   r   r   r   r   r   2       1r   r   c                       e Zd ZdZy)DisallowedRedirectz&Redirect to scheme not in allowed listNr   r   r   r   r!   r!   8   s    0r   r!   c                       e Zd ZdZy)TooManyFieldsSentzl
    The number of fields in a GET or POST request exceeded
    settings.DATA_UPLOAD_MAX_NUMBER_FIELDS.
    Nr   r   r   r   r#   r#   >       
 	r   r#   c                       e Zd ZdZy)TooManyFilesSentzk
    The number of fields in a GET or POST request exceeded
    settings.DATA_UPLOAD_MAX_NUMBER_FILES.
    Nr   r   r   r   r&   r&   G   r$   r   r&   c                       e Zd ZdZy)RequestDataTooBigzq
    The size of the request (excluding any file uploads) exceeded
    settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
    Nr   r   r   r   r(   r(   P   r$   r   r(   c                       e Zd ZdZy)RequestAbortedz=The request was closed before it was completed, or timed out.Nr   r   r   r   r*   r*   Y   s    Gr   r*   c                       e Zd ZdZy)
BadRequestz1The request is malformed and cannot be processed.Nr   r   r   r   r,   r,   _       ;r   r,   c                       e Zd ZdZy)PermissionDeniedz+The user did not have permission to do thatNr   r   r   r   r/   r/   e   r   r   r/   c                       e Zd ZdZy)ViewDoesNotExistz!The requested view does not existNr   r   r   r   r1   r1   k   s    +r   r1   c                       e Zd ZdZy)MiddlewareNotUsedz8This middleware is not used in this server configurationNr   r   r   r   r3   r3   q   s    Br   r3   c                       e Zd ZdZy)ImproperlyConfiguredz'Django is somehow improperly configuredNr   r   r   r   r5   r5   w   r   r   r5   c                       e Zd ZdZy)
FieldErrorz(Some kind of problem with a model field.Nr   r   r   r   r7   r7   }   r   r   r7   __all__c                   h     e Zd ZdZd fd	Zed        Zed        Zd Zd Z	d Z
d Zd	 Zd
 Z xZS )ValidationErrorzAn error while validating data.c                 H   t         |   |||       t        |t              rVt	        |d      r|j
                  }n=t	        |d      s|j                  }n$|j                  |j                  |j                  }}}t        |t              rTi | _        |j                         D ]9  \  }}t        |t              st        |      }|j                  | j
                  |<   ; yt        |t              rg | _        |D ]  }t        |t              st        |      }t	        |d      r>| j                  j                  t        |j
                  j                         g              h| j                  j                  |j                          y|| _        || _        || _	        | g| _        y)a  
        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.
        
error_dictmessageN)super__init__
isinstancer:   hasattrr<   
error_listr=   codeparamsdictitemslistextendsumvalues)selfr=   rC   rD   fieldmessages	__class__s         r   r?   zValidationError.__init__   sK    	$/g/w-!,,Wi0!,,(/w~~vgt$ DO#*==?x!(O<.x8H)1)<)<& $3
 & DO"!'?;-g6G7L1OO**3w/A/A/H/H/JB+OPOO**7+=+=> # #DLDI DK#fDOr   c                 0    t        | d       t        |       S Nr<   )getattrrE   rK   s    r   message_dictzValidationError.message_dict   s     	l#Dzr   c                 v    t        | d      r#t        t        |       j                         g       S t	        |       S rP   )rA   rI   rE   rJ   rG   rR   s    r   rM   zValidationError.messages   s0    4&tDz((*B//Dzr   c                    t        | d      rE| j                  j                         D ]&  \  }}|j                  |g       j	                  |       ( |S |j                  t
        g       j	                  | j                         |S rP   )rA   r<   rF   
setdefaultrH   NON_FIELD_ERRORSrB   )rK   r<   rL   rB   s       r   update_error_dictz!ValidationError.update_error_dict   ss    4&%)__%:%:%<!z%%eR077
C &=  !!"2B7>>tOr   c              #   $  K   t        | d      r;| j                  j                         D ]  \  }}|t        t	        |            f  y | j
                  D ]6  }|j                  }|j                  r||j                  z  }t        |       8 y wrP   )	rA   r<   rF   rG   r:   rB   r=   rD   str)rK   rL   errorserrorr=   s        r   __iter__zValidationError.__iter__   sx     4&!%!6!6!8vT/&"9::: "9 --<<u||+G'l"	 )s   BBc                 j    t        | d      rt        t        |             S t        t        |             S rP   )rA   reprrE   rG   rR   s    r   __str__zValidationError.__str__   s*    4&T
##DJr   c                     d| z  S )NzValidationError(%s)r   rR   s    r   __repr__zValidationError.__repr__   s    $t++r   c                 \    t        |t              st        S t        |       t        |      k(  S )N)r@   r:   NotImplementedhash)rK   others     r   __eq__zValidationError.__eq__   s%    %1!!DzT%[((r   c           
      P   t        | d      r5t        | j                  | j                  t	        | j
                        f      S t        | d      rt        t	        | j                              S t        t        t        | j                  t        j                  d                        S )Nr=   r<   )key)rA   re   r=   rC   r   rD   r<   tuplesortedrB   operator
attrgetterrR   s    r   __hash__zValidationError.__hash__   s~    4#LLII!$++.  4&doo677E&h6I6I)6TUVWWr   )NN)r   r   r	   r
   r?   propertyrS   rM   rX   r]   r`   rb   rg   rn   __classcell__)rN   s   @r   r:   r:      sS    ))%V    
	# 
,)
Xr   r:   c                       e Zd ZdZy)EmptyResultSetz)A database query predicate is impossible.Nr   r   r   r   rr   rr      s    3r   rr   c                       e Zd ZdZy)FullResultSetz1A database query predicate is matches everything.Nr   r   r   r   rt   rt      r-   r   rt   c                       e Zd ZdZy)SynchronousOnlyOperationzBThe user tried to call a sync-only function from an async context.Nr   r   r   r   rv   rv      s    Lr   rv   )r
   rl   django.utils.hashabler   	Exceptionr   r   r   r   r   r   r   r   r!   r#   r&   r(   r*   r,   r/   r1   r3   r5   r7   rW   r:   rr   rt   rv   r   r   r   <module>ry      s:    /		 		) 	# #	i 	,) ,	1 		1 		( 		, 		+ 		* 		+ 		Y 		 		y 		y 			 		9 		 	  gXi gXT	Y 		I 		y 	r   