diff options
| author | 2018-11-18 21:19:42 +0100 | |
|---|---|---|
| committer | 2018-11-18 21:19:42 +0100 | |
| commit | 2001d123aa96bc5b7f07f5be48e4e8a32372c480 (patch) | |
| tree | ab9a4abefff31098ae73371035de6a912050e312 /api/models.py | |
| parent | Add the `MessageDeletionContext` model. (diff) | |
Add the `channel_id` field to messages.
Diffstat (limited to '')
| -rw-r--r-- | api/models.py | 12 | 
1 files changed, 12 insertions, 0 deletions
| diff --git a/api/models.py b/api/models.py index bb3489d0..abbaa8bc 100644 --- a/api/models.py +++ b/api/models.py @@ -226,6 +226,18 @@ class Message(ModelReprMixin, models.Model):          on_delete=models.CASCADE,          help_text="The author of this message."      ) +    channel_id = models.BigInteger( +        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=2_000,          help_text="The content of this message, taken from Discord." | 
