aboutsummaryrefslogtreecommitdiffstats
path: root/api/models.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-09-23 13:30:56 +0200
committerGravatar Johannes Christ <[email protected]>2018-09-23 13:30:56 +0200
commit5fd256e5e6e4a30ca979f9bd4edc8daf55034699 (patch)
tree440440cf6de3cc957caaaf53ae94df1d0c1551dc /api/models.py
parentAdd the `Tag` model. (diff)
Add embed validation.
Diffstat (limited to '')
-rw-r--r--api/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/api/models.py b/api/models.py
index 58668c34..e84e28c0 100644
--- a/api/models.py
+++ b/api/models.py
@@ -4,6 +4,8 @@ from django.contrib.postgres import fields as pgfields
from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator
from django.db import models
+from .validators import validate_tag_embed
+
class ModelReprMixin:
"""
@@ -174,5 +176,6 @@ class Tag(ModelReprMixin, models.Model):
primary_key=True
)
embed = pgfields.JSONField(
- help_text="The actual embed shown by this tag."
+ help_text="The actual embed shown by this tag.",
+ validators=(validate_tag_embed,)
)