From c145eb7319f7a9660ceb1084829ee0afdc843fa2 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Mon, 8 Jun 2020 15:39:23 +0200 Subject: [PATCH] update create and update --- vm_gen/templates/html/_create.html | 3 ++- vm_gen/templates/html/_update.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 %}