{% 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 %}
{% 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 %}