
    `?i                     0   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 G d* d+e      Zd,Z G d- d.e      Z G d/ d0e      Z G d1 d2e      Z G d3 d4e      Zy)5z"
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__     h/home/cursorai/projects/django-cronjob-utils/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)ObjectNotUpdatedz$The updated object no longer exists.Nr   r   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   0   s    9r   r   c                       e Zd ZdZy)DisallowedHostz'HTTP_HOST header contains invalid valueNr   r   r   r   r    r    6       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#   <       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&   B       
 	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)   K   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+   T   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-   ]   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/   c       ;r   r/   c                       e Zd ZdZy)PermissionDeniedz+The user did not have permission to do thatNr   r   r   r   r2   r2   i   r   r   r2   c                       e Zd ZdZy)ViewDoesNotExistz!The requested view does not existNr   r   r   r   r4   r4   o   s    +r   r4   c                       e Zd ZdZy)MiddlewareNotUsedz8This middleware is not used in this server configurationNr   r   r   r   r6   r6   u   r$   r   r6   c                       e Zd ZdZy)ImproperlyConfiguredz'Django is somehow improperly configuredNr   r   r   r   r8   r8   {   r!   r   r8   c                       e Zd ZdZy)
FieldErrorz(Some kind of problem with a model field.Nr   r   r   r   r:   r:      r   r   r:   __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@   rF   rG   fieldmessages	__class__s         r   rB   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?   )getattrrH   rN   s    r   message_dictzValidationError.message_dict   s     	l#Dzr   c                 v    t        | d      r#t        t        |       j                         g       S t	        |       S rS   )rD   rL   rH   rM   rJ   rU   s    r   rP   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 rS   )rD   r?   rI   
setdefaultrK   NON_FIELD_ERRORSrE   )rN   r?   rO   rE   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rS   )	rD   r?   rI   rJ   r=   rE   r@   rG   str)rN   rO   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 rS   )rD   reprrH   rJ   rU   s    r   __str__zValidationError.__str__   s*    4&T
##DJr   c                     d| z  S )NzValidationError(%s)r   rU   s    r   __repr__zValidationError.__repr__   s    $t++r   c                 \    t        |t              st        S t        |       t        |      k(  S )N)rC   r=   NotImplementedhash)rN   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)rD   rh   r@   rF   r   rG   r?   tuplesortedrE   operator
attrgetterrU   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
   rB   propertyrV   rP   r[   r`   rc   re   rj   rq   __classcell__)rQ   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   ru   ru      s    3r   ru   c                       e Zd ZdZy)FullResultSetz1A database query predicate is matches everything.Nr   r   r   r   rw   rw      r0   r   rw   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   ry   ry      s    Lr   ry   )r
   ro   django.utils.hashabler   	Exceptionr   r   r   r   r   r   r   r   r    r#   r&   r)   r+   r-   r/   r2   r4   r6   r8   r:   rZ   r=   ru   rw   ry   r   r   r   <module>r|      sF    /		 		) 	# #/y /	i 	,) ,	1 		1 		( 		, 		+ 		* 		+ 		Y 		 		y 		y 			 		9 		 	  gXi gXT	Y 		I 		y 	r   