diff options
Diffstat (limited to 'api/models.py')
-rw-r--r-- | api/models.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/api/models.py b/api/models.py index fa68f31c..86c99f86 100644 --- a/api/models.py +++ b/api/models.py @@ -5,7 +5,7 @@ from django.core.validators import MaxValueValidator, MinValueValidator, RegexVa from django.db import models from django.utils import timezone -from .validators import validate_tag_embed +from .validators import validate_bot_setting_name, validate_tag_embed class ModelReprMixin: @@ -27,6 +27,19 @@ class ModelReprMixin: return f'<{self.__class__.__name__}({attributes})>' +class BotSetting(ModelReprMixin, models.Model): + """A configuration entry for the bot.""" + + name = models.CharField( + primary_key=True, + max_length=50, + validators=(validate_bot_setting_name,) + ) + data = pgfields.JSONField( + help_text="The actual settings of this setting." + ) + + class DocumentationLink(ModelReprMixin, models.Model): """A documentation link used by the `!docs` command of the bot.""" |