diff options
author | 2022-03-20 15:10:47 -0700 | |
---|---|---|
committer | 2022-03-20 15:10:47 -0700 | |
commit | 96122b7522bf2900c5f059dcdcc547d5e93dc1ad (patch) | |
tree | a70dfa87a8bca9279e98da272e7a95ba3ff287e6 /pydis_site/apps/api/models | |
parent | Merge pull request #694 from camcaswell/role-update (diff) | |
parent | fixup: don't use "We" in docstring (diff) |
Merge #663 - bumped threads endpoint
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r-- | pydis_site/apps/api/models/__init__.py | 3 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/__init__.py | 3 | ||||
-rw-r--r-- | pydis_site/apps/api/models/bot/bumped_thread.py | 22 |
3 files changed, 26 insertions, 2 deletions
diff --git a/pydis_site/apps/api/models/__init__.py b/pydis_site/apps/api/models/__init__.py index 4f616986..a197e988 100644 --- a/pydis_site/apps/api/models/__init__.py +++ b/pydis_site/apps/api/models/__init__.py @@ -1,9 +1,10 @@ # flake8: noqa from .bot import ( - FilterList, BotSetting, + BumpedThread, DocumentationLink, DeletedMessage, + FilterList, Infraction, Message, MessageDeletionContext, diff --git a/pydis_site/apps/api/models/bot/__init__.py b/pydis_site/apps/api/models/bot/__init__.py index ec0e701c..013bb85e 100644 --- a/pydis_site/apps/api/models/bot/__init__.py +++ b/pydis_site/apps/api/models/bot/__init__.py @@ -1,8 +1,9 @@ # flake8: noqa -from .filter_list import FilterList from .bot_setting import BotSetting +from .bumped_thread import BumpedThread from .deleted_message import DeletedMessage from .documentation_link import DocumentationLink +from .filter_list import FilterList from .infraction import Infraction from .message import Message from .aoc_completionist_block import AocCompletionistBlock diff --git a/pydis_site/apps/api/models/bot/bumped_thread.py b/pydis_site/apps/api/models/bot/bumped_thread.py new file mode 100644 index 00000000..cdf9a950 --- /dev/null +++ b/pydis_site/apps/api/models/bot/bumped_thread.py @@ -0,0 +1,22 @@ +from django.core.validators import MinValueValidator +from django.db import models + +from pydis_site.apps.api.models.mixins import ModelReprMixin + + +class BumpedThread(ModelReprMixin, models.Model): + """A list of thread IDs to be bumped.""" + + thread_id = models.BigIntegerField( + primary_key=True, + help_text=( + "The thread ID that should be bumped." + ), + validators=( + MinValueValidator( + limit_value=0, + message="Thread IDs cannot be negative." + ), + ), + verbose_name="Thread ID", + ) |