Skip to content

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

Description

@AdditionAddict

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions