You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+1. Would be nice if we could {% render_field field attr_dict=attr_dict %}, if attr_dict is provided in context.
Especially for working with django-components where keys in context dict can change, reduces the annoyance to have a million nested if attr, render_fileld, and endif statements and ensure you have every permutation like:
{% if attr %}
{% if attr1 %}
{% if attr2 %}
{% render_field field attr=attr attr1=attr1 attr2=attr2 %}
{% else %}
{% render_field field attr=attr attr1=attr1 %}
{% endif %}
{% elif attr2 %}
{% render_field field attr=attr attr2=attr2 %}
{% else %}
{% render_field field attr=attr %}
{% elif attr1 %}
{% if attr2 %}
{% render_field field attr1=attr1 attr2=attr2 %}
{% else %}
{% render_field field attr1=attr1 %}
{% elif attr2 %}
{% render_field field attr2=attr2 %}
{% endif %}
The
attr
filter is nice to append HTML attributes to form fields but it would be nicer being able to also use it without fields like this:I couldn't find this feature request in the open tickets. Please excuse if this is a duplicate.
The text was updated successfully, but these errors were encountered: