forgot newer sql alchemy needs separation .join() per table

This commit is contained in:
2023-07-04 23:08:23 +10:00
parent 1e7a47f43e
commit 99b4239633

View File

@@ -107,7 +107,7 @@ def author(id):
def authors_books(author_id):
""" show all the books written by the specified author """
from main import Book, Book_Author_Link
books=Book.query.join(Book_Author_Link,Author).filter(Author.id==author_id).order_by(Book.title).all()
books=Book.query.join(Book_Author_Link).join(Author).filter(Author.id==author_id).order_by(Book.title).all()
# now need to re-order books to cater for sub-book ordering
ordered_books=[]