forgot newer sql alchemy needs separation .join() per table
This commit is contained in:
@@ -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=[]
|
||||
|
||||
Reference in New Issue
Block a user