diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index 1e1d8d20..fb20ee25 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')]