mirror of
https://github.com/janeczku/calibre-web.git
synced 2024-11-24 08:42:24 +02:00
Bugfixes for sqlalchemy 1.4.0
This commit is contained in:
parent
837fc4988d
commit
fc85586809
12
cps/db.py
12
cps/db.py
@ -627,15 +627,17 @@ class CalibreDB():
|
||||
randm = self.session.query(Books) \
|
||||
.filter(self.common_filters(allow_show_archived)) \
|
||||
.order_by(func.random()) \
|
||||
.limit(self.config.config_random_books)
|
||||
.limit(self.config.config_random_books).all()
|
||||
else:
|
||||
randm = false()
|
||||
off = int(int(pagesize) * (page - 1))
|
||||
query = self.session.query(database) \
|
||||
.filter(db_filter) \
|
||||
query = self.session.query(database)
|
||||
if len(join) == 3:
|
||||
query = query.outerjoin(join[0], join[1]).outerjoin(join[2])
|
||||
elif len(join) == 2:
|
||||
query = query.outerjoin(join[0], join[1])
|
||||
query = query.filter(db_filter)\
|
||||
.filter(self.common_filters(allow_show_archived))
|
||||
if len(join):
|
||||
query = query.join(*join, isouter=True)
|
||||
entries = list()
|
||||
pagination = list()
|
||||
try:
|
||||
|
@ -502,6 +502,7 @@ def render_author_books(page, author_id, order):
|
||||
db.Books.authors.any(db.Authors.id == author_id),
|
||||
[order[0], db.Series.name, db.Books.series_index],
|
||||
db.books_series_link,
|
||||
db.Books.id == db.books_series_link.c.book,
|
||||
db.Series)
|
||||
if entries is None or not len(entries):
|
||||
flash(_(u"Oops! Selected book title is unavailable. File does not exist or is not accessible"),
|
||||
@ -530,6 +531,7 @@ def render_publisher_books(page, book_id, order):
|
||||
db.Books.publishers.any(db.Publishers.id == book_id),
|
||||
[db.Series.name, order[0], db.Books.series_index],
|
||||
db.books_series_link,
|
||||
db.Books.id == db.books_series_link.c.book,
|
||||
db.Series)
|
||||
return render_title_template('index.html', random=random, entries=entries, pagination=pagination, id=book_id,
|
||||
title=_(u"Publisher: %(name)s", name=publisher.name), page="publisher")
|
||||
@ -583,7 +585,9 @@ def render_category_books(page, book_id, order):
|
||||
db.Books,
|
||||
db.Books.tags.any(db.Tags.id == book_id),
|
||||
[order[0], db.Series.name, db.Books.series_index],
|
||||
db.books_series_link, db.Series)
|
||||
db.books_series_link,
|
||||
db.Books.id == db.books_series_link.c.book,
|
||||
db.Series)
|
||||
return render_title_template('index.html', random=random, entries=entries, pagination=pagination, id=book_id,
|
||||
title=_(u"Category: %(name)s", name=name.name), page="category")
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user