aboutsummaryrefslogtreecommitdiffstats
path: root/api/models.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-09-01 23:20:22 +0200
committerGravatar Johannes Christ <[email protected]>2018-09-05 21:32:04 +0200
commitb3a8093895c33e820c1193ece39bd10d1a4965ee (patch)
tree04ebb9c74cde86a76840e048ed44da849e89e4e2 /api/models.py
parentOnly push `nging` on `master` and `django`. (diff)
Add the `Tag` model.
Diffstat (limited to 'api/models.py')
-rw-r--r--api/models.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/api/models.py b/api/models.py
index 5d7dfc35..4e4de9e0 100644
--- a/api/models.py
+++ b/api/models.py
@@ -104,3 +104,30 @@ class Member(models.Model):
Role,
help_text="Any roles this user has on our server."
)
+
+
+class Tag(models.Model):
+ """A tag providing (hopefully) useful content, shown by the bot."""
+
+ author = models.ForeignKey(
+ Member,
+ help_text="The user that originally created this tag.",
+ on_delete=models.CASCADE
+ )
+ title = models.CharField(
+ max_length=256,
+ help_text="The title of this tag, displayed in the Embed.",
+ unique=True
+ )
+ content = models.CharField(
+ max_length=2048,
+ help_text="The content of this tag, displayed in the Embed."
+ )
+ image_url = models.URLField(
+ null=True,
+ help_text="An optional image to display in the tag embed."
+ )
+ thumbnail_url = models.URLField(
+ null=True,
+ help_text="An optional thumbnail to display in the tag embed."
+ )