
    Evg                        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dS )3z.
Global Django exception and warning classes.
    N)make_hashablec                       e Zd ZdZdS )FieldDoesNotExistz(The requested model field does not existN__name__
__module____qualname____doc__     S/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/django/core/exceptions.pyr   r   
           22Dr   r   c                       e Zd ZdZdS )AppRegistryNotReadyz-The django.apps registry is not populated yetNr   r   r   r   r   r      s        77Dr   r   c                       e Zd ZdZdZdS )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dS )MultipleObjectsReturnedz?The query returned multiple objects when only one was expected.Nr   r   r   r   r   r      s        IIDr   r   c                       e Zd ZdZdS )SuspiciousOperationz!The user did something suspiciousNr   r   r   r   r   r   "   s        ++++r   r   c                       e Zd ZdZdS )SuspiciousMultipartFormz+Suspect MIME request in multipart form dataNr   r   r   r   r   r   &           55Dr   r   c                       e Zd ZdZdS )SuspiciousFileOperationz/A Suspicious filesystem operation was attemptedNr   r   r   r   r   r   ,   s        99Dr   r   c                       e Zd ZdZdS )DisallowedHostz'HTTP_HOST header contains invalid valueNr   r   r   r   r   r   2           11Dr   r   c                       e Zd ZdZdS )DisallowedRedirectz&Redirect to scheme not in allowed listNr   r   r   r   r!   r!   8   s        00Dr   r!   c                       e Zd ZdZdS )TooManyFieldsSentzl
    The number of fields in a GET or POST request exceeded
    settings.DATA_UPLOAD_MAX_NUMBER_FIELDS.
    Nr   r   r   r   r#   r#   >            
 	Dr   r#   c                       e Zd ZdZdS )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dS )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dS )RequestAbortedz=The request was closed before it was completed, or timed out.Nr   r   r   r   r*   r*   Y   s        GGDr   r*   c                       e Zd ZdZdS )
BadRequestz1The request is malformed and cannot be processed.Nr   r   r   r   r,   r,   _           ;;Dr   r,   c                       e Zd ZdZdS )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dS )ViewDoesNotExistz!The requested view does not existNr   r   r   r   r1   r1   k   s        ++Dr   r1   c                       e Zd ZdZdS )MiddlewareNotUsedz8This middleware is not used in this server configurationNr   r   r   r   r3   r3   q   s        BBDr   r3   c                       e Zd ZdZdS )ImproperlyConfiguredz'Django is somehow improperly configuredNr   r   r   r   r5   r5   w   r   r   r5   c                       e Zd ZdZdS )
FieldErrorz(Some kind of problem with a model field.Nr   r   r   r   r7   r7   }   r   r   r7   __all__c                   t     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.Nc                 ~   t                                          |||           t          |t                    rEt	          |d          r|j        }n-t	          |d          s|j        }n|j        |j        |j	        }}}t          |t                    rVi | _        |                                D ]8\  }}t          |t                    st          |          }|j        | j        |<   9dS t          |t                    rg | _        |D ]}t          |t                    st          |          }t	          |d          r@| j                            t          |j                                        g                      v| j                            |j                   dS || _        || _        || _	        | g| _        dS )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__   s    	$///g// 	Vw-- V!,Wi00 V!,(/w~vgt$$ 	% DO#*==?? = =x!(O<< 9.x88H)1)<&&= =
 && 	% DO" ? ?!'?;; 7-g66G7L11 ?O**3w/A/H/H/J/JB+O+OPPPPO**7+=>>>>? ? #DLDI DK#fDOOOr   c                 @    t          | d           t          |           S Nr<   )getattrrE   rK   s    r   message_dictzValidationError.message_dict   s      	l###Dzzr   c                     t          | d          r/t          t          |                                           g           S t	          |           S rP   )rA   rI   rE   rJ   rG   rR   s    r   rM   zValidationError.messages   sB    4&& 	0tDzz((**B///Dzzr   c                    t          | d          rI| j                                        D ].\  }}|                    |g                               |           /n3|                    t
          g                               | j                   |S rP   )rA   r<   rF   
setdefaultrH   NON_FIELD_ERRORSrB   )rK   r<   rL   rB   s       r   update_error_dictz!ValidationError.update_error_dict   s    4&& 	P%)_%:%:%<%< D D!z%%eR0077
CCCCD !!"2B77>>tOOOr   c              #     K   t          | d          rA| j                                        D ]%\  }}|t          t	          |                    fV  &d S | j        D ]+}|j        }|j        r
||j        z  }t          |          V  ,d S rP   )	rA   r<   rF   rG   r:   rB   r=   rD   str)rK   rL   errorserrorr=   s        r   __iter__zValidationError.__iter__   s      4&& 	#!%!6!6!8!8 ; ;vT/&"9"9:::::::; ;  # #-< ,u|+G'll""""	# #r   c                     t          | d          rt          t          |                     S t          t          |                     S rP   )rA   reprrE   rG   rR   s    r   __str__zValidationError.__str__   s<    4&& 	$T

###DJJr   c                     d| z  S )NzValidationError(%s)r   rR   s    r   __repr__zValidationError.__repr__   s    $t++r   c                 z    t          |t                    st          S t          |           t          |          k    S )N)r@   r:   NotImplementedhash)rK   others     r   __eq__zValidationError.__eq__   s1    %11 	"!!DzzT%[[((r   c           
      d   t          | d          r.t          | 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## 	LI!$+..   4&& 	8do66777E&h6I)6T6TUUUVVWWWr   )NN)r   r   r	   r
   r?   propertyrS   rM   rX   r]   r`   rb   rg   rn   __classcell__)rN   s   @r   r:   r:      s        )))% )% )% )% )% )%V   X   X
  	# 	# 	#     
, , ,) ) )
X X X X X X Xr   r:   c                       e Zd ZdZdS )EmptyResultSetz)A database query predicate is impossible.Nr   r   r   r   rr   rr      s        33Dr   rr   c                       e Zd ZdZdS )FullResultSetz1A database query predicate is matches everything.Nr   r   r   r   rt   rt      r-   r   rt   c                       e Zd ZdZdS )SynchronousOnlyOperationzBThe user tried to call a sync-only function from an async context.Nr   r   r   r   rv   rv      s        LLDr   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 gX gX gX gXi gX gX gXT	 	 	 	 	Y 	 	 		 	 	 	 	I 	 	 		 	 	 	 	y 	 	 	 	 	r   