I have a create and an update
notes views.
Each view has the same form to create/update a note.
I was wondering on a good way to render the value of my content only in the update view but not in the create view.
Here what I have today :
<div class="field">
{{ form.title.label }}
{% if request.endpoint == 'notes.update' %}
<div class="control">
{{ form.title(class="input", value=note.title) }}
</div>
{% else %}
<div class="control">
{{ form.title(class="input"}}
</div>
{% endif %}
</div>
I use a condition on the endpoint to do what I want but I don't think it's a good way to do this.
Thank you for help 🙏