o
    lf
                     @   s   d dl mZ d dlmZmZmZmZ d dlmZ d dl	m
Z d dl	mZ G dd deZG dd	 d	eZeG d
d dZG dd deZG dd deZdS )    )ValidationError)MaxLengthValidatorMaxValueValidatorMinLengthValidatorMinValueValidator)deconstructible)gettext_lazy)ngettext_lazyc                   @      e Zd ZedddZdS )ArrayMaxLengthValidatorzRList contains %(show_value)d item, it should contain no more than %(limit_value)d.zSList contains %(show_value)d items, it should contain no more than %(limit_value)d.limit_valueN__name__
__module____qualname__r	   message r   r   f/var/www/ticemtrilhas/avaliacao_env/lib/python3.10/site-packages/django/contrib/postgres/validators.pyr          r   c                   @   r
   )ArrayMinLengthValidatorzSList contains %(show_value)d item, it should contain no fewer than %(limit_value)d.zTList contains %(show_value)d items, it should contain no fewer than %(limit_value)d.r   Nr   r   r   r   r   r      r   r   c                   @   s@   e Zd ZdZededdZdZdddZd	d
 Zdd Z	dS )KeysValidatorz9A validator designed for HStore to require/restrict keys.z Some keys were missing: %(keys)sz)Some unknown keys were provided: %(keys)s)missing_keys
extra_keysFNc                 C   s0   t || _|| _|d uri | j|| _d S d S N)setkeysstrictmessages)selfr   r   r   r   r   r   __init__+   s
   
zKeysValidator.__init__c                 C   sn   t |}| j| }|rt| jd ddd|id| jr3|| j }|r5t| jd ddd|idd S d S )Nr   r   z, )codeparamsr   )r   r   r   r   joinr   )r   valuer   r   r   r   r   r   __call__1   s$   

zKeysValidator.__call__c                 C   s0   t || jo| j|jko| j|jko| j|jkS r   )
isinstance	__class__r   r   r   )r   otherr   r   r   __eq__C   s   


zKeysValidator.__eq__)FN)
r   r   r   __doc___r   r   r   r$   r(   r   r   r   r   r   !   s    
r   c                   @      e Zd Zdd ZedZdS )RangeMaxValueValidatorc                 C   s   |j d u p	|j |kS r   )upperr   abr   r   r   compareM      zRangeMaxValueValidator.comparezMEnsure that the upper bound of the range is not greater than %(limit_value)s.Nr   r   r   r1   r*   r   r   r   r   r   r,   L   
    r,   c                   @   r+   )RangeMinValueValidatorc                 C   s   |j d u p	|j |k S r   )lowerr.   r   r   r   r1   V   r2   zRangeMinValueValidator.comparezJEnsure that the lower bound of the range is not less than %(limit_value)s.Nr3   r   r   r   r   r5   U   r4   r5   N)django.core.exceptionsr   django.core.validatorsr   r   r   r   django.utils.deconstructr   django.utils.translationr   r*   r	   r   r   r   r,   r5   r   r   r   r   <module>   s    

*	