Answer the question
In order to leave comments, you need to log in
How to store and display a list of numbers in the database?
There is a model, let it be Person . This model has a phone_number field . In the model it looks like this
class Person(models.Model):
...
phone_number = models.CharField(
...
validators=[
RegexValidator(
regex=u'^[0-9\(\)\-\+,\'\s]+$',
message=u'Это поле может содержать только номер телефона в формате "+7(999)999-99-99"',
code='invalid_symbols'
)
],
)
...
'+7(231)242-34-12', '+7(123)412-34-12',
"'+7(231)242-34-12', '+7(123)412-34-12',"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question