
i4Vdc           @   s:   d  d l  m Z d  d l m Z d e f d     YZ d S(   i(   t   checks(   t   BaseDatabaseValidationt   DatabaseValidationc           B   s   e  Z d    Z RS(   c      	   K   s   d d l  m } t t |   j | |  } t | d d  d k r | j |  } | d k rb | S| j d  r | j	 r | j
 d k s t | j
  d k r | j t j d d d d | d	 d
  q n  | S(   s   
        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.
        i(   t
   connectiont   remote_fieldt   varchari   sB   MySQL does not allow unique CharFields to have a max_length > 255.t   hintt   objt   ids
   mysql.E001N(   t	   django.dbR   t   superR   t   check_fieldt   getattrt   Nonet   db_typet
   startswitht   uniquet
   max_lengtht   intt   appendR    t   Error(   t   selft   fieldt   kwargsR   t   errorst
   field_type(    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/backends/mysql/validation.pyR      s     	$(   t   __name__t
   __module__R   (    (    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/backends/mysql/validation.pyR      s   N(   t   django.coreR    t"   django.db.backends.base.validationR   R   (    (    (    sq   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/db/backends/mysql/validation.pyt   <module>   s   