template

With the philosophy of escape hatches, at the edge we enable replacing the entire rendering of components with the template config. You can use it in Table cells, to render table rows, to replace the rendering of fields, inputs, headers, and more. The template argument supports two types of values:

Template path

Strings are interpreted as template paths:

form = Form.create(
    auto__model=Artist,
    fields__name__template='test_template_as_path.html',
)
▼ Hide result

Template object

Pass a Django Template object to write the template code you want inline:

form = Form.create(
    auto__model=Artist,
    fields__name__template=Template('template contents <b>here</b>'),
)
▼ Hide result