diff options
Diffstat (limited to 'api/models.py')
-rw-r--r-- | api/models.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/api/models.py b/api/models.py index 6dce0eb4..5ca274ce 100644 --- a/api/models.py +++ b/api/models.py @@ -369,3 +369,42 @@ class Infraction(ModelReprMixin, models.Model): if self.hidden: s += " (hidden)" return s + + +class Reminder(ModelReprMixin, models.Model): + """A reminder created by a user.""" + + active = models.BooleanField( + default=True, + help_text=( + "Whether this reminder is still active. " + "If not, it has been sent out to the user." + ) + ) + author = models.ForeignKey( + User, + on_delete=models.CASCADE, + help_text="The creator of this reminder." + ) + channel_id = models.BigIntegerField( + help_text=( + "The channel ID that this message was " + "sent in, taken from Discord." + ), + validators=( + MinValueValidator( + limit_value=0, + message="Channel IDs cannot be negative." + ), + ) + ) + content = models.CharField( + max_length=1500, + help_text="The content that the user wants to be reminded of." + ) + expiration = models.DateTimeField( + help_text="When this reminder should be sent." + ) + + def __str__(self): + return f"{self.content} on {self.expiration} by {self.author}" |