{% set template = frappe.db.get_value('Print Format Field Template', df.field_template, ['template', 'template_file', 'standard'], as_dict=1) %} {{ frappe.render_template(template.template_file if template.standard else template.template, {'doc': doc}) }}