def render(self, ctx, req): if ISource.providedBy(ctx): ctx = ctx.bibtex() elif IDataTable.providedBy(ctx): ctx = Database([s.bibtex() for s in ctx.get_query()]) return ctx.format(self.extension)