Update select.html

In relations.py:
relations.py:PrimaryKeyRelatedField.to_representation mostly (by default) returns an integer, but RelatedField.choices converts all to the string. That is why "select" field on "update" action, usually does not work correctly.
This commit is contained in:
Andrii Skomorokhov 2015-07-30 19:08:17 +03:00
parent aa3f844b3d
commit 14532757f6

View File

@ -11,7 +11,7 @@
{% endif %}
{% for key, text in field.choices.items %}
<option value="{{ key }}" {% if key == field.value %}selected{% endif %}>{{ text }}</option>
<option value="{{ key }}" {% if key == field.value|slugify %}selected{% endif %}>{{ text }}</option>
{% endfor %}
</select>