Пример #1
0
 def GET(self):
     i = web.input(work_ids='', edition_ids='')
     ol_work_ids = i.work_ids.split(',')
     ol_edition_ids = i.edition_ids.split(',')
     result = lending.get_availablility_of_works(ol_work_ids) if i.work_ids else \
              lending.get_availability_of_editions(ol_edition_ids)
     return delegate.RawText(simplejson.dumps(result),
                             content_type="application/json")
Пример #2
0
 def get_book_availability(self, id_type, ids):
     return (
         lending.get_availability_of_works(ids) if id_type == "openlibrary_work"
         else
         lending.get_availability_of_editions(ids) if id_type == "openlibrary_edition"
         else
         lending.get_availability_of_ocaids(ids) if id_type == "identifier"
         else []
     )
Пример #3
0
 def get_book_availability(self, id_type, ids):
     return (
         lending.get_availability_of_works(ids) if id_type == "openlibrary_work"
         else
         lending.get_availability_of_editions(ids) if id_type == "openlibrary_edition"
         else
         lending.get_availability_of_ocaids(ids) if id_type == "identifier"
         else []
     )