View Single Post
Old 04-14-2023, 01:08 PM   #577
isarl
Addict
isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.isarl ought to be getting tired of karma fortunes by now.
 
Posts: 293
Karma: 2534928
Join Date: Nov 2022
Location: Canada
Device: Kobo Aura 2
Quote:
Originally Posted by chaley View Post
The error tells you that the book_values() function can't be used in a composite column. See https://www.mobileread.com/forums/sh...35#post4235735 for how to get around this.

The problem is that those functions can be slow. Since you are writing in Python you would be better served using the calibre database API, which is much faster. Glancing at your template I think you want
Code:
context.db.new_api.get_custom_book_data('#ranking')
Thanks for this Charles, I'm not very experienced at writing templates which query the rest of the library, so I haven't encountered this yet and just tinkered in the template tester until it appeared to work well enough.
isarl is offline   Reply With Quote