diff --git a/vm_gen/templates/html/_create.html b/vm_gen/templates/html/_create.html index d028ac8..35f7394 100644 --- a/vm_gen/templates/html/_create.html +++ b/vm_gen/templates/html/_create.html @@ -9,7 +9,7 @@ + [%- for value, display in column.choices.items() %] [%- endfor %] diff --git a/vm_gen/templates/html/_update.html b/vm_gen/templates/html/_update.html index c0da90c..7dfe636 100644 --- a/vm_gen/templates/html/_update.html +++ b/vm_gen/templates/html/_update.html @@ -11,9 +11,9 @@ {%- for sub_instance in model_views.[[ column.name ]].model.query.all() %} + {% if sub_instance in instance.[[ column.name|pluralize ]] %}selected="selected"{% endif %}>{{ sub_instance }} [%- else %] - {% if instance.[[ column.name ]]_id == sub_instance.id %}selected="selected"{% endif %}>{{ sub_instance.name }} + {% if instance.[[ column.name ]]_id == sub_instance.id %}selected="selected"{% endif %}>{{ sub_instance }} [%- endif %] {%- endfor %}