OwlCyberSecurity - MANAGER
Edit File: validation.cpython-312.pyc
� U��g- � � � d dl Z e j dk\ rd dlmZ nd dlmZ e j dk rd dlmZ nd dlmZ d dlm Z G d� d e� Z y) � N)� � )�BaseDatabaseValidation�r � )�models)�checks)� connectionc �J � � e Zd Zej dk rd� Z� xZS � fd�Z� xZS )�DatabaseValidationr c �& � t j t j t j f}t ||� rV|j dkD rF|j r9d}|j |||j |j j d�z � yyyy)�� MySQL has the following field length restriction: No character (varchar) fields can have a length exceeding 255 characters if they have a unique index on them. � zY"%(name)s": %(cls)s cannot have a "max_length" greater than 255 when using "unique=True".)�name�clsN)r � CharField�CommaSeparatedIntegerField� SlugField� isinstance� max_length�unique�addr � __class__�__name__)�self�errors�opts�f�varchar_fields�msgs �x/opt/hc_python/lib64/python3.12/site-packages/../../../lib/python3.12/site-packages/mysql/connector/django/validation.py�validate_fieldz!DatabaseValidation.validate_field s� � � %�.�.�$�?�?�$�.�.�0�N� �!�^�,�����1C����<��� � �4�����/0�{�{�/C�/C�(E� "E� F� IQ�1C�,� c �N �� t t | � |fi |��}t |dd� ��|j t � }|�|S |j d� rX|j rL|j �t |j � dkD r(|j t j dd|d�� � |S )r �relN�varcharr zBMySQL does not allow unique CharFields to have a max_length > 255.z mysql.E001)�hint�obj�id) �superr �check_field�getattr�db_typer � startswithr r �int�appendr �Error)r �field�kwargsr � field_typer s �r! r+ zDatabaseValidation.check_field# s� �� � �-�t�@�� K�CI�K�F� �u�e�T�*�2�"�]�]�:�6� ��%�!�M��)�)�)�4�!�L�L�"�-�-�5�%(��)9�)9�%:�S�%@��M�M����1�!%� %�+��� �Mr# )r � __module__�__qualname__�django�VERSIONr"