From 59c45ee43e10737f6aa48ef929b56b176886d0bf Mon Sep 17 00:00:00 2001 From: Hasan <31344273+ImportErr@users.noreply.github.com> Date: Thu, 29 Nov 2018 19:10:39 +0000 Subject: Added regex validator to special snake name. (#153) --- api/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api/models.py') diff --git a/api/models.py b/api/models.py index 7623c86c..c67f558d 100644 --- a/api/models.py +++ b/api/models.py @@ -111,7 +111,8 @@ class SpecialSnake(ModelReprMixin, models.Model): name = models.CharField( max_length=140, primary_key=True, - help_text='A special snake name.' + help_text='A special snake name.', + validators=[RegexValidator(regex=r'^([^0-9])+$')] ) info = models.TextField( help_text='Info about a special snake.' -- cgit v1.2.3