o
    uvXj›  ã                   @   s,  d Z G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZ	G dd„ deƒZ
G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd „ d eƒZd!ZG d"d#„ d#eƒZG d$d%„ d%eƒZd&S )'z.
Global Django exception and warning classes.
c                   @   ó   e Zd ZdZdS )ÚFieldDoesNotExistz(The requested model field does not existN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   úS/var/www/html/myproject/venv/lib/python3.10/site-packages/django/core/exceptions.pyr      ó    r   c                   @   r   )ÚAppRegistryNotReadyz-The django.apps registry is not populated yetNr   r   r   r   r	   r      r
   r   c                   @   s   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   c                   @   r   )ÚMultipleObjectsReturnedz?The query returned multiple objects when only one was expected.Nr   r   r   r   r	   r      r
   r   c                   @   r   )ÚSuspiciousOperationz!The user did something suspiciousNr   r   r   r   r	   r      s    r   c                   @   r   )ÚSuspiciousMultipartFormz+Suspect MIME request in multipart form dataNr   r   r   r   r	   r      r
   r   c                   @   r   )ÚSuspiciousFileOperationz/A Suspicious filesystem operation was attemptedNr   r   r   r   r	   r   #   r
   r   c                   @   r   )ÚDisallowedHostz'HTTP_HOST header contains invalid valueNr   r   r   r   r	   r   (   r
   r   c                   @   r   )ÚDisallowedRedirectz&Redirect to scheme not in allowed listNr   r   r   r   r	   r   -   r
   r   c                   @   r   )ÚTooManyFieldsSentzl
    The number of fields in a GET or POST request exceeded
    settings.DATA_UPLOAD_MAX_NUMBER_FIELDS.
    Nr   r   r   r   r	   r   2   ó    r   c                   @   r   )ÚRequestDataTooBigzq
    The size of the request (excluding any file uploads) exceeded
    settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
    Nr   r   r   r   r	   r   :   r   r   c                   @   r   )ÚPermissionDeniedz+The user did not have permission to do thatNr   r   r   r   r	   r   B   r
   r   c                   @   r   )ÚViewDoesNotExistz!The requested view does not existNr   r   r   r   r	   r   G   r
   r   c                   @   r   )ÚMiddlewareNotUsedz8This middleware is not used in this server configurationNr   r   r   r   r	   r   L   r
   r   c                   @   r   )ÚImproperlyConfiguredz'Django is somehow improperly configuredNr   r   r   r   r	   r   Q   r
   r   c                   @   r   )Ú
FieldErrorz(Some kind of problem with a model field.Nr   r   r   r   r	   r   V   r
   r   Ú__all__c                       sZ   e Zd ZdZd‡ fdd„	Zedd„ ƒZedd„ ƒZd	d
„ Zdd„ Z	dd„ Z
dd„ Z‡  ZS )ÚValidationErrorzAn error while validating data.Nc                    s  t ƒ  |||¡ t|tƒr*t|dƒr|j}nt|dƒs|j}n|j|j|j	}}}t|t
ƒrLi | _| ¡ D ]\}}t|tƒsCt|ƒ}|j| j|< q6dS t|tƒr}g | _|D ]$}t|tƒsat|ƒ}t|dƒrs| j t|j ¡ g ƒ¡ qV| j |j¡ qVd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   r%   r&   ÚfieldÚmessages©Ú	__class__r   r	   r!   `   s6   	




ý


ù
zValidationError.__init__c                 C   s   t | dƒ t| ƒS ©Nr   )Úgetattrr'   ©r-   r   r   r	   Úmessage_dict‹   s   
zValidationError.message_dictc                 C   s$   t | dƒrtt| ƒ ¡ g ƒS t| ƒS r2   )r#   r+   r'   r,   r)   r4   r   r   r	   r/   “   s   
zValidationError.messagesc                 C   sL   t | dƒr| j ¡ D ]\}}| |g ¡ |¡ q
|S | tg ¡ | j¡ |S r2   )r#   r   r(   Ú
setdefaultr*   ÚNON_FIELD_ERRORSr$   )r-   r   r.   r$   r   r   r	   Úupdate_error_dict™   s   
ÿz!ValidationError.update_error_dictc                 c   sf   � t | dƒr| j ¡ D ]\}}|tt|ƒƒfV  qd S | jD ]}|j}|jr+||j; }t|ƒV  qd S r2   )	r#   r   r(   r)   r   r$   r   r&   Ústr)r-   r.   ÚerrorsÚerrorr   r   r   r	   Ú__iter__¡   s   €
ÿ

üzValidationError.__iter__c                 C   s"   t | dƒrtt| ƒƒS tt| ƒƒS r2   )r#   Úreprr'   r)   r4   r   r   r	   Ú__str__¬   s   
zValidationError.__str__c                 C   s   d|  S )NzValidationError(%s)r   r4   r   r   r	   Ú__repr__±   s   zValidationError.__repr__)NN)r   r   r   r   r!   Úpropertyr5   r/   r8   r<   r>   r?   Ú__classcell__r   r   r0   r	   r   ^   s    +

r   c                   @   r   )ÚEmptyResultSetz)A database query predicate is impossible.Nr   r   r   r   r	   rB   µ   r
   rB   N)r   Ú	Exceptionr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r7   r   rB   r   r   r   r	   Ú<module>   s(    W