This is probably super simple. But I'm using WTForms and want to set the value of a field to a variable I pull from the database. But instead of displaying the dynamic variable, it's displaying the variable name.
{{ form.question.label }}
{{ form.question(value="{{ q.question }}") }}
{{ form.slug.label }}
{{ form.slug(value="{{ q.slug }}") }}
So in the field it says "{{ q.question }}" instead of something like "What is the meaning of life?".
Is there a way to display nested variables in Jinja? Or is there some other way I need to go about this? Any help is appreciated!
take out the double quotes and the template tags.
{{ form.question(value=q.question) }}
and the same for slug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With