{#- events.admin.form.fields: the edition selector. The events admin route maps the form by model columns, so edition_id is saved with no route change. Expects `event` (None when adding one). It offers what editions.event_choices allows the account, None standing for "No edition" (see signals.py). The events form is drawn on a POST only to show a refused save again, and then the edition that was picked stays selected. -#} {%- if request.method == 'POST' and 'edition_id' in request.form %} {%- set picked = request.form.get('edition_id', '') %} {%- else %} {%- set picked = (event.edition_id | string) if event and event.edition_id else '' %} {%- endif %}