diff options
author | 2018-11-29 19:10:39 +0000 | |
---|---|---|
committer | 2018-11-29 20:10:39 +0100 | |
commit | 59c45ee43e10737f6aa48ef929b56b176886d0bf (patch) | |
tree | accb3567c1866f09599bd077f5cfb4b7fee7cf27 /api/models.py | |
parent | Set up image pushing and building on Azure. (#152) (diff) |
Added regex validator to special snake name. (#153)
Diffstat (limited to 'api/models.py')
-rw-r--r-- | api/models.py | 3 |
1 files changed, 2 insertions, 1 deletions
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.' |