Closed khanh96le closed 5 years ago
Yes beceause Model is the same object as db.Model it's just an alias, I forgot why I did this.
https://github.com/gothinkster/flask-realworld-example-app/blob/master/conduit/database.py#L11
But if the Model class inherited from db.Model, it cannot use the functions in CRUDMixin. I think that is the reason you did it.
@jerry-le yes exactly CRUDMixin is used as a base class for models that's why http://flask-sqlalchemy.pocoo.org/2.3/customizing/
I just wonder that why when we declare a model, the class should be inherited
Model
but notdb.Model
. I checkedid(Model)
, andid(db.Model)
, both return the same value.Does anyone know the reason?