def get_current_and_available_loans(self): current_loans = borrow.get_edition_loans(self) current_and_available_loans = ( current_loans, self._get_available_loans(current_loans), ) return current_and_available_loans
def get_current_loans(self): return borrow.get_edition_loans(self)
def _is_loaned_out(book_key): from openlibrary.plugins.upstream import borrow book = web.ctx.site.get(book_key) return borrow.get_edition_loans(book) != []