{% load maintain_extras %} {% with wrapper as child_wrapper %} {% for field, wrapper in wrapper.parent.items %} {% with instance|get:field as instance %} {% for field in wrapper.fields %} {% if child_wrapper|link %} {{instance|get:field}} {% else %} {{instance|get:field}} {% endif %} {% endfor %} {% for field, wrapper in wrapper.one_to_one.items %} {% with instance|get:field as instance %} {% if wrapper|link %} {% for field in wrapper.fields %} {{ instance|get:field }} {% endfor %} {% else %} {% for field in wrapper.fields %} {{ instance|get:field }} {% endfor %} {% endif %} {% endwith %} {% endfor %} {% endwith %} {% endfor %} {% endwith %} {% for field, wrapper in wrapper.children.items %} {% with instance|get:field as instance %} {% if instance %} {% for field, wrapper in wrapper.many_to_one.items %} {% with instance|get:field as instance %} {% if wrapper|link %} {% for field in wrapper.fields %} {{field}}: {{ instance|get:field }} {% endfor %} {% else %} {% for field in wrapper.fields %} {{field}}: {{ instance|get:field }} {% endfor %} {% endif %} {% endwith %} {% endfor %} {% for field in wrapper.fields %} {% if wrapper|link %} {{instance|get:field}} {% else %} {{instance|get:field}} {% endif %} {% endfor %} {% endif %} {% endwith %} {% endfor %} {% for field in wrapper.fields %} {% if link %} {{instance|get:field}} {% else %} {{instance|get:field}} {% endif %} {% endfor %}