'Marshmallow' object has no attribute 'ModelSchema'
Conf.py
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
db = SQLAlchemy(app)
ma = Marshmallow(app)
# flask-marshmallow<0.12.0
class UserSchema(ma.ModelSchema):
class Meta:
model = User
# flask-marshmallow>=0.12.0 (recommended)
from conf import ma
class UserSchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = User
load_instance = True
# flask-marshmallow>=0.12.0 (not recommended)
from marshmallow_sqlalchemy import ModelSchema
class UserSchema(ModelSchema):
class Meta:
model = User
sql_session = db.session
I hate when it happens, but i got the answer immediately after posting...
Was installed only flask-marshmallow, but
pipenv install marshmallow-sqlalchemy
needed to add to work with SQLAlchemy. Whole code stays the same.
Maybe it will help someone... Now i got a different issue but that's another story.