def get_books(self): i = web.input(sort='editions', page=1) try: page = int(i.page) except ValueError: page = 1 return works_by_author(self.get_olid(), sort=i.sort, page=page, rows=100)
def get_books(self): i = web.input(sort='editions', page=1) try: # safegaurd from passing zero/negative offsets to solr page = max(1, int(i.page)) except ValueError: page = 1 return works_by_author(self.get_olid(), sort=i.sort, page=page, rows=100)
def get_books(self, q=''): i = web.input(sort='editions', page=1, rows=20, mode="") try: # safegaurd from passing zero/negative offsets to solr page = max(1, int(i.page)) except ValueError: page = 1 return works_by_author(self.get_olid(), sort=i.sort, page=page, rows=i.rows, has_fulltext=i.mode=="ebooks", query=q)
def get_work_count(self): """Returns the number of works by this author. """ # TODO: avoid duplicate works_by_author calls result = works_by_author(self.get_olid(), rows=0) return result.num_found
def get_books(self, sort='editions', offset=0, limit=1000): i = web.input(sort='editions') return works_by_author(self.get_olid(), i.sort, offset, limit)