Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

models. type for phone number in django

from django.core.validators import RegexValidator

class Person(models.Model):
    phoneNumberRegex = RegexValidator(regex = r"^+?1?d{8,15}$")
    phoneNumber = models.CharField(validators = [phoneNumberRegex], max_length = 16, unique = True)
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #type #phone #number #django
ADD COMMENT
Topic
Name
6+9 =