Uses separate activitypub type of suggestion lists

This commit is contained in:
Mouse Reeve 2024-08-27 11:34:35 -07:00
parent 5deb779efd
commit 1bccffaa9b
3 changed files with 11 additions and 2 deletions

View file

@ -15,7 +15,7 @@ from .note import Review, Rating
from .note import Tombstone from .note import Tombstone
from .ordered_collection import OrderedCollection, OrderedCollectionPage from .ordered_collection import OrderedCollection, OrderedCollectionPage
from .ordered_collection import CollectionItem, ListItem, ShelfItem from .ordered_collection import CollectionItem, ListItem, ShelfItem
from .ordered_collection import BookList, Shelf from .ordered_collection import BookList, SuggestionList, Shelf
from .person import Person, PublicKey from .person import Person, PublicKey
from .response import ActivitypubResponse from .response import ActivitypubResponse
from .book import Edition, Work, Author from .book import Edition, Work, Author

View file

@ -39,10 +39,18 @@ class BookList(OrderedCollectionPrivate):
summary: str = None summary: str = None
curation: str = "closed" curation: str = "closed"
book: str = None
type: str = "BookList" type: str = "BookList"
@dataclass(init=False)
class SuggestionList(OrderedCollectionPrivate):
"""structure of an ordered collection activity"""
summary: str = None
book: str = None
type: str = "SuggestionList"
# pylint: disable=invalid-name # pylint: disable=invalid-name
@dataclass(init=False) @dataclass(init=False)
class OrderedCollectionPage(ActivityObject): class OrderedCollectionPage(ActivityObject):

View file

@ -69,6 +69,7 @@ class SuggestionList(AbstractList):
related_name="suggestion_list", related_name="suggestion_list",
unique=True, unique=True,
) )
activity_serializer = activitypub.SuggestionList
@property @property
def collection_queryset(self): def collection_queryset(self):