I don't know where the attribute 'cache_api" is defined. Is it something you made?
In any event, here is a calibre python template that returns all the current series names.
Code:
python:
python:
def evaluate(book, context):
series_names = context.db.new_api.all_field_names('series')
return ', '.join(series_names)
Going from your example, I would use
Code:
series_names = self.db.new_api.all_field_names('series')
But if you are looking for all the books for a given series then
Code:
series_id = context.db.new_api.get_item_id('series', 'Bah')
# should check for None
series_books = context.db.new_api.books_for_field('series', series_id)