o
    {,h                     @   s  d Z ddlZddlm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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G d/d0 d0eZG d1d2 d2eZdS )3z"
Global Django exception classes.
    N)make_hashablec                   @      e Zd ZdZdS )FieldDoesNotExistz(The requested model field does not existN__name__
__module____qualname____doc__ r
   r
   L/var/www/html/rh/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   2   r   r   c                   @   r   )DisallowedRedirectz&Redirect to scheme not in allowed listNr   r
   r
   r
   r   r   8   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   >       r   c                   @   r   )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   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   P   r   r   c                   @   r   )RequestAbortedz=The request was closed before it was completed, or timed out.Nr   r
   r
   r
   r   r   Y   r   r   c                   @   r   )
BadRequestz1The request is malformed and cannot be processed.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   e   r   r   c                   @   r   )ViewDoesNotExistz!The requested view does not existNr   r
   r
   r
   r   r   k   r   r   c                   @   r   )MiddlewareNotUsedz8This middleware is not used in this server configurationNr   r
   r
   r
   r   r   q   r   r   c                   @   r   )ImproperlyConfiguredz'Django is somehow improperly configuredNr   r
   r
   r
   r   r   w   r   r   c                   @   r   )
FieldErrorz(Some kind of problem with a model field.Nr   r
   r
   r
   r   r    }   r   r    __all__c                       sj   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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,   r2   r
   r
   r   message_dict   s   
zValidationError.message_dictc                 C   s$   t | drtt|  g S t| S r7   )r(   r0   r,   r1   r.   r9   r
   r
   r   r4      s   
zValidationError.messagesc                 C   sL   t | dr| j D ]\}}||g | q
|S |tg | j |S r7   )r(   r#   r-   
setdefaultr/   NON_FIELD_ERRORSr)   )r2   r#   r3   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 r7   )	r(   r#   r-   r.   r"   r)   r$   r+   str)r2   r3   errorserrorr$   r
   r
   r   __iter__   s   


zValidationError.__iter__c                 C   s"   t | drtt| S tt| S r7   )r(   reprr,   r.   r9   r
   r
   r   __str__   s   
zValidationError.__str__c                 C   s   d|  S )NzValidationError(%s)r
   r9   r
   r
   r   __repr__   s   zValidationError.__repr__c                 C   s   t |tstS t| t|kS )N)r'   r"   NotImplementedhash)r2   otherr
   r
   r   __eq__   s   
zValidationError.__eq__c                 C   sV   t | drt| j| jt| jfS t | drtt| jS ttt| j	t
ddS )Nr$   r#   )key)r(   rF   r$   r*   r   r+   r#   tuplesortedr)   operator
attrgetterr9   r
   r
   r   __hash__   s   

zValidationError.__hash__)NN)r   r   r   r	   r&   propertyr:   r4   r=   rA   rC   rD   rH   rN   __classcell__r
   r
   r5   r   r"      s    +

r"   c                   @   r   )EmptyResultSetz)A database query predicate is impossible.Nr   r
   r
   r
   r   rQ      r   rQ   c                   @   r   )FullResultSetz1A database query predicate is matches everything.Nr   r
   r
   r
   r   rR      r   rR   c                   @   r   )SynchronousOnlyOperationzBThe user tried to call a sync-only function from an async context.Nr   r
   r
   r
   r   rS      r   rS   )r	   rL   django.utils.hashabler   	Exceptionr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r<   r"   rQ   rR   rS   r
   r
   r
   r   <module>   s6    			j