jinja2.environment.Environment.getattr

Environment.getattr(obj, attribute)[source]

Get an item or attribute of an object but prefer the attribute. Unlike getitem() the attribute must be a bytestring.