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

ImportError for JSONField #2

Open
unmade opened this issue Nov 11, 2018 · 3 comments
Open

ImportError for JSONField #2

unmade opened this issue Nov 11, 2018 · 3 comments

Comments

@unmade
Copy link

unmade commented Nov 11, 2018

Hi there! Thanks for a great library.

Originally I installed social-app-flask-peewee. Unfortunately it doesn't work correctly for peewee >= 3.0.0 because of line 5 in storage.py:

File "/usr/local/lib/python3.7/site-packages/social_peewee/storage.py", line 5, in <module>
app_1  |     from playhouse.kv import JSONField
app_1  | ImportError: cannot import name 'JSONField' from 'playhouse.kv' (/usr/local/lib/python3.7/site-packages/playhouse/kv.py)

Starting from version 3 peewee has JSONField only for postgres and doesn't have generic one.

Do you have any idea how to fix this?

I see two choice:

  • limit library to work only with postgres (preferably with version >= 9.4)
  • write own generic JSONField (like it was in peewee < 3)
dmlb2000 added a commit to dmlb2000/social-storage-peewee that referenced this issue Dec 25, 2018
Since peewee>3.0 JSONField was moved to extensions modules for
both SQLite and Postgres. All we need is a generic one so we wrap
TextField.

Signed-off-by: David Brown <[email protected]>
dmlb2000 added a commit to dmlb2000/social-storage-peewee that referenced this issue Jan 3, 2019
Since peewee>3.0 JSONField was moved to extensions modules for
both SQLite and Postgres. All we need is a generic one so we wrap
TextField.

Signed-off-by: David Brown <[email protected]>
@qwadratic
Copy link

@omab @unmade
Hi there,
Experiencing the same issue
Is the pull request ready to merge?

@unmade
Copy link
Author

unmade commented Feb 27, 2020

@EternalFlow I guess PR is ready, but no one has merged it yet. The fix is in this branch dmlb2000:fix-2-define-jsonfield

@qwadratic
Copy link

qwadratic commented Feb 27, 2020

@EternalFlow I guess PR is ready, but no one has merged it yet. The fix is in this branch dmlb2000:fix-2-define-jsonfield

Thanks)

this

pip install -e git://github.com/dmlb2000/social-storage-peewee.git@fix-2-define-jsonfield#egg=social-auth-storage-peewee

hotfixed the issue for me

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

No branches or pull requests

2 participants