Skip to content

Instantly share code, notes, and snippets.

@Buzovskiy
Created July 19, 2022 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Buzovskiy/4de4122d59dcc2f10130cbae87facd02 to your computer and use it in GitHub Desktop.
Save Buzovskiy/4de4122d59dcc2f10130cbae87facd02 to your computer and use it in GitHub Desktop.
Django form render field with choices
<tr>
<td class="action-checkbox">
<input
type="{{ form.xml.field.widget.input_type }}"
name="xml"
value="{{ value }}"
class="action-select"
id="id_xml_{{ forloop.counter0 }}"
{% if value in form.xml.data %} checked="checked" {% endif %}
>
</td>
<th class="field-__str__"><a href="{% url 'admin:exchange-download-xml' value %}">{{ label.relative_path }}</a></th>
<th class="field-__str__">{{ label.date_created }}</th>
<th class="field-__str__">{{ label.size }}</th>
<th class="field-__str__"></th>
</tr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment