
    2i                        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 classes.
    N)make_hashablec                       e Zd ZdZy)FieldDoesNotExistz(The requested model field does not existN__name__
__module____qualname____doc__     U/var/www/html/secretsanta/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)DisallowedRedirectz8Redirect was too long or scheme was not in allowed list.Nr   r   r   r   r!   r!   8       B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   r0   r0   e   r   r   r0   c                       e Zd ZdZy)ViewDoesNotExistz!The requested view does not existNr   r   r   r   r2   r2   k   s    +r   r2   c                       e Zd ZdZy)MiddlewareNotUsedz8This middleware is not used in this server configurationNr   r   r   r   r4   r4   q   r"   r   r4   c                       e Zd ZdZy)ImproperlyConfiguredz'Django is somehow improperly configuredNr   r   r   r   r6   r6   w   r   r   r6   c                       e Zd ZdZy)
FieldErrorz(Some kind of problem with a model field.Nr   r   r   r   r8   r8   }   r   r   r8   __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>   rD   rE   fieldmessages	__class__s         r   r@   zValidationError.__init__   sU    	$/g/w-!,,Wi0!,,(/w~~vgt$ DO#*==? =x!(O<.x8H)1)<)<&=
 & 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=   )getattrrF   rL   s    r   message_dictzValidationError.message_dict   s     	l#Dzr   c                 v    t        | d      r#t        t        |       j                         g       S t	        |       S rQ   )rB   rJ   rF   rK   rH   rS   s    r   rN   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 rQ   )rB   r=   rG   
setdefaultrI   NON_FIELD_ERRORSrC   )rL   r=   rM   rC   s       r   update_error_dictz!ValidationError.update_error_dict   sz    4&%)__%:%:%< D!z%%eR077
CD  !!"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rQ   )	rB   r=   rG   rH   r;   rC   r>   rE   str)rL   rM   errorserrorr>   s        r   __iter__zValidationError.__iter__   s     4&!%!6!6!8 ;vT/&"9:::;  #--<<u||+G'l"	#s   BBc                 j    t        | d      rt        t        |             S t        t        |             S rQ   )rB   reprrF   rH   rS   s    r   __str__zValidationError.__str__   s*    4&T
##DJr   c                     d| z  S )NzValidationError(%s)r   rS   s    r   __repr__zValidationError.__repr__   s    $t++r   c                 \    t        |t              st        S t        |       t        |      k(  S )N)rA   r;   NotImplementedhash)rL   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)rB   rf   r>   rD   r   rE   r=   tuplesortedrC   operator
attrgetterrS   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@   propertyrT   rN   rY   r^   ra   rc   rh   ro   __classcell__)rO   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   rs   rs      s    3r   rs   c                       e Zd ZdZy)FullResultSetz1A database query predicate is matches everything.Nr   r   r   r   ru   ru      r.   r   ru   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   rw   rw      s    Lr   rw   )r
   rm   django.utils.hashabler   	Exceptionr   r   r   r   r   r   r   r   r!   r$   r'   r)   r+   r-   r0   r2   r4   r6   r8   rX   r;   rs   ru   rw   r   r   r   <module>rz      s:    /		 		) 	# #	i 	,) ,	1 		1 		( 		, 		+ 		* 		+ 		Y 		 		y 		y 			 		9 		 	  gXi gXT	Y 		I 		y 	r   