P
P
pcdesign2016-01-15 10:54:46
Flask
pcdesign, 2016-01-15 10:54:46

How to show today's date when using wtform?

Here is the form.py file, it contains a class:

class BoringForm(Form):
    until = DateField('Дата отправления', format='%d.%m.%Y',  
                default=datetime.today(),  validators=[DataRequired()])


But, in fact, the value is cached, and until flask is restarted, the old date will be shown.
Application launch date, not today's actual date.

<input class="form-control" id="until" name="until" required type="text" value="13.01.2016">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2016-01-15
@pcdesign

Remove the brackets.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question