在Marshmallow中,我有一个简单的架构,如下所示:
feedparser._gen_georss_coords, _gen_georss_coords = (saveit, feedparser._gen_georss_coords)
当我使用此架构序列化结果列表时,我得到:
class MySchema(Schema):
class Meta:
fields = ("somefieldA", "somefieldB")
my_schema = MySchema(only=["somefieldB"], many=True)
相反,我想生成:
[
{
"somefieldB": "foo"
},
{
"somefieldB": "bar"
}
]
谢谢!