diff options
author | 2018-09-01 00:23:54 +0200 | |
---|---|---|
committer | 2018-09-01 17:11:30 +0200 | |
commit | e9c65c836f5d269d0f597986f6ec37214e5edd92 (patch) | |
tree | 108bea6b0eb74b776ecceda18959a171d72589fb | |
parent | Merge branch 'django' into django+documentation-link-api (diff) |
Add the `OffTopicChannelName` model.
-rw-r--r-- | api/migrations/0002_offtopicchannelname.py | 20 | ||||
-rw-r--r-- | api/models.py | 9 |
2 files changed, 29 insertions, 0 deletions
diff --git a/api/migrations/0002_offtopicchannelname.py b/api/migrations/0002_offtopicchannelname.py new file mode 100644 index 00000000..890cd81f --- /dev/null +++ b/api/migrations/0002_offtopicchannelname.py @@ -0,0 +1,20 @@ +# Generated by Django 2.1 on 2018-08-31 22:21 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='OffTopicChannelName', + fields=[ + ('name', models.CharField(max_length=96, primary_key=True, serialize=False, validators=[django.core.validators.RegexValidator(regex='^[a-z0-9-]+$')])), + ], + ), + ] diff --git a/api/models.py b/api/models.py index 877e3622..7f4175af 100644 --- a/api/models.py +++ b/api/models.py @@ -1,3 +1,4 @@ +from django.core.validators import RegexValidator from django.db import models @@ -9,6 +10,14 @@ class DocumentationLink(models.Model): inventory_url = models.URLField() +class OffTopicChannelName(models.Model): + name = models.CharField( + primary_key=True, + max_length=96, + validators=(RegexValidator(regex=r'^[a-z0-9-]+$'),) + ) + + class SnakeName(models.Model): """A snake name used by the bot's snake cog.""" |