jinja2.nodes.TemplateData.iter_fields

TemplateData.iter_fields(exclude=None, only=None)

This method iterates over all fields that are defined and yields (key, value) tuples. Per default all fields are returned, but it’s possible to limit that to some fields by providing the only parameter or to exclude some using the exclude parameter. Both should be sets or tuples of field names.