Device {{ loop.index }}
{% for field in device %}
{% if field.name not in ['csrf_token', 'sensors', 'controls'] %}
{{ field.label }}
{{ field() }}
{% for error in field.errors %}
{{ error }}
{% endfor %}
{% endif %}
{% endfor %}
{% for sensor in device.sensors %}
Sensor {{ loop.index }}
{% for field in sensor %}
{% if field.name != "csrf_token" %}
{{ field.label }} {{ field() }}
{% endif %}
{% endfor %}
{% endfor %}
{% for control in device.controls %}
Control {{ loop.index }}
{% for field in control %}
{% if field.name != "csrf_token" %}
{{ field.label }} {{ field() }}
{% endif %}
{% endfor %}
{% endfor %}