Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuerySelectField gets ignored by form.process(obj='some_object') or MyForm=MyForm(obj='some_object') #144

Open
AdditionAddict opened this issue Mar 11, 2019 · 0 comments

Comments

@AdditionAddict
Copy link

Is there a nicer way to pre-populate a form that includes a QuerySelectField than either giving up and using a selectfield or having to manually assign every field as the following people were forced to?

Following person gave up on queryselectfield:
https://stackoverflow.com/questions/50564319/flask-queryselectfield-edit-form/50577713#comment96939968_50577713

Following person was forced to manually assign each field value:
https://stackoverflow.com/questions/36851172/flask-wtforms-queryselectfield-render-queryselectfield-with-a-choice-selected

QuerySelectField gets ignored by the following:

form = MyForm()
form.process(obj='some_object')

or

MyForm=MyForm(obj='some_object')

The only way round is to manually assign each field value

MyForm=MyForm(some_query_select_field='some_object', every_other_field='value', ...)

wich defeats the niceness of what QuerySelectField gives you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant