From 7bcf0a1d53f2f28302ef6302b208373de936ee93 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 31 Dec 2020 07:46:35 -0800 Subject: [PATCH] Fixes missing code for editions list json --- bookwyrm/models/book.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index 1e1d8d207..fb20ee25b 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -126,6 +126,14 @@ class Work(OrderedCollectionPageMixin, Book): ''' in case the default edition is not set ''' return self.default_edition or self.editions.first() + def to_edition_list(self, **kwargs): + ''' an ordered collection of editions ''' + return self.to_ordered_collection( + self.editions.all(), + remote_id='%s/editions' % self.remote_id, + **kwargs + ) + activity_serializer = activitypub.Work serialize_reverse_fields = [('editions', 'editions')] deserialize_reverse_fields = [('editions', 'editions')]