Unverified Commit a0dfc0ef authored by Jason Grider's avatar Jason Grider Committed by GitHub

fix-issue1602-peewee-basemodel

This fixes issue described in 1602 and 1606 where the Peewee ORM changed their function for BaseModel to ModelBase in Peewee 3.0 and greater. This should work for Peewee versions less than 3.0 as well.
parent 06aebf07
from wtforms import fields
from peewee import (CharField, DateTimeField, DateField, TimeField,
PrimaryKeyField, ForeignKeyField, BaseModel)
PrimaryKeyField, ForeignKeyField)
# Fix for Issue: #1602 & #1606
# Section below trys BaseModel (for versions of PeeWee < 3.0) and if that fails,
# load the new ModelBase as BaseModel (to not break things looking for BaseModel in flask-peewee and etc.)
try:
from peewee import BaseModel
except ImportError:
from peewee import ModelBase as BaseModel
from wtfpeewee.orm import ModelConverter, model_form
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment