1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-29 14:27:41 +00:00

Bugfixes for sqlalchemy 1.4.0

This commit is contained in:
Ozzie Isaacs
2021-03-22 16:04:53 +01:00
parent 837fc4988d
commit fc85586809
2 changed files with 12 additions and 6 deletions

View File

@@ -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: