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

WTForms 3.1.0 expanded SelectField choices parameter #2395

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cjmayo
Copy link
Contributor

@cjmayo cjmayo commented Oct 21, 2023

  File "/home/runner/work/flask-admin/flask-admin/flask_admin/templates/bootstrap2/admin/lib.html", line 183, in template
    {{ render_field(form, f, kwargs) }}
  File "/home/runner/work/flask-admin/flask-admin/.tox/py/lib/python3.10/site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/home/runner/work/flask-admin/flask-admin/flask_admin/templates/bootstrap2/admin/lib.html", line 137, in template
    {{ field(**kwargs)|safe }}
  File "/home/runner/work/flask-admin/flask-admin/.tox/py/lib/python3.10/site-packages/wtforms/fields/core.py", line 176, in __call__
    return self.meta.render_field(self, kwargs)
  File "/home/runner/work/flask-admin/flask-admin/.tox/py/lib/python3.10/site-packages/wtforms/meta.py", line 64, in render_field
    return field.widget(field, **render_kw)
  File "/home/runner/work/flask-admin/flask-admin/flask_admin/form/widgets.py", line 28, in __call__
    return super(Select2Widget, self).__call__(field, **kwargs)
  File "/home/runner/work/flask-admin/flask-admin/.tox/py/lib/python3.10/site-packages/wtforms/widgets/core.py", line 365, in __call__
    for val, label, selected, render_kw in field.iter_choices():
ValueError: not enough values to unpack (expected 4, got 3)

This is to illustrate the location of the problem for #2391. Clearly it doesn't allow you to use the new option from WTForms 3.1 and I expect it's going to break with WTForms < 3.1.

  File "/home/runner/work/flask-admin/flask-admin/flask_admin/templates/bootstrap2/admin/lib.html", line 183, in template
    {{ render_field(form, f, kwargs) }}
  File "/home/runner/work/flask-admin/flask-admin/.tox/py/lib/python3.10/site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/home/runner/work/flask-admin/flask-admin/flask_admin/templates/bootstrap2/admin/lib.html", line 137, in template
    {{ field(**kwargs)|safe }}
  File "/home/runner/work/flask-admin/flask-admin/.tox/py/lib/python3.10/site-packages/wtforms/fields/core.py", line 176, in __call__
    return self.meta.render_field(self, kwargs)
  File "/home/runner/work/flask-admin/flask-admin/.tox/py/lib/python3.10/site-packages/wtforms/meta.py", line 64, in render_field
    return field.widget(field, **render_kw)
  File "/home/runner/work/flask-admin/flask-admin/flask_admin/form/widgets.py", line 28, in __call__
    return super(Select2Widget, self).__call__(field, **kwargs)
  File "/home/runner/work/flask-admin/flask-admin/.tox/py/lib/python3.10/site-packages/wtforms/widgets/core.py", line 365, in __call__
    for val, label, selected, render_kw in field.iter_choices():
ValueError: not enough values to unpack (expected 4, got 3)
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

Successfully merging this pull request may close these issues.

None yet

1 participant