mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 04:51:11 +00:00
Uses separate activitypub type of suggestion lists
This commit is contained in:
parent
5deb779efd
commit
1bccffaa9b
3 changed files with 11 additions and 2 deletions
|
@ -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
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue