3
̜^i                 @   s<   d Z ddlmZ ddlmZ dZdZdZdZdZ	d	d
 Z
dS )z
Validators
    )unicode_literals)ValidationErrorz(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9]\.[^\s]{2,})$z^\+?1?\d{9,16}$zm^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$z>^PT((?P<hours>\d+)H)?((?P<minutes>\d+)M)?((?P<seconds>\d+)S)?$z	^.{6,15}$c             C   sD   | dkrt ddddidn$t| dk r<t ddddidn| S dS )	z
    Validate Password
    Django provides a flexible password storage system.
    By default, Django uses the PBKDF2 algorithm with a
    SHA256 hash, a password stretching mechanism
    recommended by NIST.
    Nzthis cannot be blank requiredpassword)codeparams   zMust have at least 6 chars 
min_length)r   len)r    r   H/home/hotel/hotelbackend/hotelapplication/hotelmanage/core/validators.pyvalidate_password   s    r   N)__doc__
__future__r   django.core.exceptionsr   Z	REGEX_URLZREGEX_MOBILE_NUMBERZYOUTUBE_URL_REGEXZYOUTUBE_DURATION_REGEXPASSWORD_REGEXr   r   r   r   r   <module>   s   