'Return an ordered list of all books in the series.
The list contains book ids.'

def books_in_series(self, series_id):

    ans = self.conn.get('SELECT    book    from    books_series_link    WHERE    series=?', (series_id,))
    if (not ans):
        return []
    ans = [id[0] for id in ans]
    ans.sort(cmp=(lambda x, y: cmp(self.series_index(x, True), self.series_index(y, True))))
    return ans
