我有 0.13.0 版本的烧瓶棉花糖
我可以在flask应用程序中访问SQLAlchemyAutoSchema
当我尝试运行应用程序时,出现以下错误
AttributeError: 'Marshmallow' object has no attribute 'SQLAlchemyAutoSchema'
烧瓶棉花糖的初始化
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
db = SQLAlchemy()
ma = Marshmallow()
我已经用flask app注册了db和ma 代码:
from apis import ma
from apis.models import User
class UserSchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = User
答案 0 :(得分:0)
flask-marshmallow
has a dependency on marshmallow-sqlalchemy
用于要定义的 SQLAlchemySchema
类。
确保您还安装了 marshmallow-sqlalchemy
。