def parseRetBooklists(ret): booklists = [] for row in ret: name = row[0] ID = parseIntListString(row[1]) booklist = BookList(name, ID) booklists.append(booklist) return booklists
def parseRetAuthors(ret): authors = [] for row in ret: name = row[0] books = parseIntListString(row[1]) author = Author(name, books) authors.append(author) return authors
def getBooksByAuthor(self, author_name): self.connect() ret = self.cursor.execute("select * from %s where name='%s'" % (self.author_table, author_name)) books = [] for row in ret: ID = parseIntListString(row[2]) books.append(ID) self.close() return books