diff options
author | 2022-02-19 17:59:26 +0000 | |
---|---|---|
committer | 2022-03-16 21:52:06 +0000 | |
commit | 0aed5f7913e7ce268ddb56127f84a5386ede5739 (patch) | |
tree | 080039ca0d001c67e01a5cb5b33f3700a7479b5f /pydis_site/apps/api/serializers.py | |
parent | Move FilterList imports down so they're sorted (diff) |
Add support for BumpedThreads to be stored in site
Following our move to use Redis as just a cache, this PR allows the site to store a list of threads that need to be bumped.
The bot will interact with this within the ThreadBumper cog.
Diffstat (limited to 'pydis_site/apps/api/serializers.py')
-rw-r--r-- | pydis_site/apps/api/serializers.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pydis_site/apps/api/serializers.py b/pydis_site/apps/api/serializers.py index c97f7dba..b9e06081 100644 --- a/pydis_site/apps/api/serializers.py +++ b/pydis_site/apps/api/serializers.py @@ -16,6 +16,7 @@ from .models import ( AocAccountLink, AocCompletionistBlock, BotSetting, + BumpedThread, DeletedMessage, DocumentationLink, FilterList, @@ -41,6 +42,16 @@ class BotSettingSerializer(ModelSerializer): fields = ('name', 'data') +class BumpedThreadSerializer(ModelSerializer): + """A class providing (de-)serialization of `BumpedThread` instances.""" + + class Meta: + """Metadata defined for the Django REST Framework.""" + + model = BumpedThread + fields = ('thread_id',) + + class DeletedMessageSerializer(ModelSerializer): """ A class providing (de-)serialization of `DeletedMessage` instances. |