fix choice

This commit is contained in:
Daniel Tsvetkov 2020-06-08 18:07:06 +02:00
parent 967b47876f
commit 625fe533d5
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@
</select>
[%- elif column.type in ['choice', ] %]
<select id="input-[[ name|camel_to_snake ]]-[[ column.name ]]"
name="[[ column.name ]]_id">
name="[[ column.name ]]">
<option selected="selected" value="">Choose...</option>
[%- for value, display in column.choices.items() %]
<option value="[[ value ]]" {% if instance and instance.[[ column.name ]] == "[[ value ]]" %}selected="selected"{% endif %}>[[ display ]]</option>

View File

@ -23,7 +23,7 @@
</select>
[%- elif column.type in ['choice', ] %]
<select id="input-[[ name|camel_to_snake ]]-[[ column.name ]]"
name="[[ column.name ]]_id">
name="[[ column.name ]]">
[%- for value, display in column.choices.items() %]
<option value="[[ value ]]" {% if instance.[[ column.name ]] == "[[ value ]]" %}selected="selected"{% endif %}>[[ display ]]</option>
[%- endfor %]