biosustain / potion

Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine
http://potion.readthedocs.io
Other
488 stars 51 forks source link

Support Peewee 3 #133

Open lyschoening opened 6 years ago

shayneoneill commented 3 years ago

I guess this never got fixed? Maybe worth putting a note up that peewee3 isn't supported. This has bitten me pretty hard.

shayneoneill commented 3 years ago

The fixes, by the way, seem to be

if column.primary_key or model._meta.name in model._meta.refs: (mentioned in linked issue, change rel to refs)

and

meta['name'] = model._meta.db_table.lower() becomes meta['name'] = model._meta.table_name.lower()