aboutsummaryrefslogtreecommitdiffstats
path: root/api/models.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-09-22 00:06:09 +0200
committerGravatar Johannes Christ <[email protected]>2018-09-22 00:13:00 +0200
commit127fd34cd97c2cd3dc9e7f0d5e255b80120e8d27 (patch)
tree27779969b36e022d1496703347412cb018eeb40d /api/models.py
parentAdd `__str__` to all API models. (diff)
Add the `Tag` model.
Diffstat (limited to 'api/models.py')
-rw-r--r--api/models.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/api/models.py b/api/models.py
index 6b681ebc..58668c34 100644
--- a/api/models.py
+++ b/api/models.py
@@ -1,5 +1,6 @@
from operator import itemgetter
+from django.contrib.postgres import fields as pgfields
from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator
from django.db import models
@@ -159,3 +160,19 @@ class Member(ModelReprMixin, models.Model):
def __str__(self):
return f"{self.name}#{self.discriminator}"
+
+
+class Tag(ModelReprMixin, models.Model):
+ """A tag providing (hopefully) useful information."""
+
+ title = models.CharField(
+ max_length=100,
+ help_text=(
+ "The title of this tag, shown in searches and providing "
+ "a quick overview over what this embed contains."
+ ),
+ primary_key=True
+ )
+ embed = pgfields.JSONField(
+ help_text="The actual embed shown by this tag."
+ )