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

ValueError: too many values to unpack #30

Open
msteidley opened this issue Jan 5, 2018 · 3 comments
Open

ValueError: too many values to unpack #30

msteidley opened this issue Jan 5, 2018 · 3 comments

Comments

@msteidley
Copy link

Getting this error when:
following installation instructions,
scaffolding a new flask-diamond application,
logging in as [email protected]

and trying to edit a user:
ValueError: too many values to unpack

@msteidley
Copy link
Author

Flask-Diamond 0.5.2rc6

Do I need to install an older version to get this working?

@iandennismiller
Copy link
Member

Hmmm... The root cause is that the example application extends the default model.User by adding a "name" field, but the CRUD interface hadn't been updated to reflect this. I thought I fixed this by Flask-Diamond 0.5.2rc6. I'll take another look.

@henryk
Copy link

henryk commented Jan 24, 2018

@iandennismiller Are you sure that's the root cause here (sounds more like you're talking about #23). @msteidley didn't give a stack trace, but to me it sounds like they hit pallets-eco/flask-admin#1588 which is a bug in flask-admin that makes it fail with recent versions of sqlalchemy.

Steps to reproduce:

  1. In an application created with flask-diamond, do pip install --upgrade -r requirements.txt
  2. Log in as admin, open the /admin/ interface, try to edit a User object

Actual results:

  • At step 1, SQLAlchemy-1.2.1 is installed.
  • At step 2, an exception is raised deep in flask-admin, which ends with
  File "[...]/venv/lib/python3.5/site-packages/flask_admin/contrib/sqla/fields.py", line 255, in get_pk_from_identity
    cls, key = identity_key(instance=obj)
ValueError: too many values to unpack (expected 2)

Workaround:

  • Include sqlalchemy==1.2.0b3 into requirements.txt
  • pip install --upgrade -r requirements.txt will downgrade the sqlalchemy version to one that still works with flask-admin

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

3 participants