diff options
author | 2018-09-23 13:30:56 +0200 | |
---|---|---|
committer | 2018-09-23 13:30:56 +0200 | |
commit | 5fd256e5e6e4a30ca979f9bd4edc8daf55034699 (patch) | |
tree | 440440cf6de3cc957caaaf53ae94df1d0c1551dc /api/models.py | |
parent | Add the `Tag` model. (diff) |
Add embed validation.
Diffstat (limited to 'api/models.py')
-rw-r--r-- | api/models.py | 5 |
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,) ) |