Only show editions with the author on the author page
This commit is contained in:
parent
43202f5bb7
commit
553f170f89
3 changed files with 12 additions and 1 deletions
|
@ -241,6 +241,10 @@ class Work(OrderedCollectionPageMixin, Book):
|
|||
"""in case the default edition is not set"""
|
||||
return self.editions.order_by("-edition_rank").first()
|
||||
|
||||
def author_edition(self, author):
|
||||
"""in case the default edition doesn't have the required author"""
|
||||
return self.editions.filter(authors=author).order_by("-edition_rank").first()
|
||||
|
||||
def to_edition_list(self, **kwargs):
|
||||
"""an ordered collection of editions"""
|
||||
return self.to_ordered_collection(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue