-
-
Notifications
You must be signed in to change notification settings - Fork 403
Open
Labels
documentationRelated to the documentationRelated to the documentation
Description
The docs says this about SelectField:
Note that the choices keyword is only evaluated once, so if you want to make a dynamic drop-down list, you’ll want to assign the choices list to the field after instantiation.
https://wtforms.readthedocs.io/en/3.2.x/fields/#wtforms.fields.SelectField
But it seems that in current version (3.2) the field is processed differently and each time you create a form during a request, it runs the init() method of the SelectField class, and if choices is a callable, it will be called each time you create a form to populate field choices. Therefore I suggest to correct the docs, if it is an expected behaviour, because now they describe different one.
Metadata
Metadata
Assignees
Labels
documentationRelated to the documentationRelated to the documentation