Created
October 20, 2014 22:16
-
-
Save sloria/8b92ffd50fbf8efaae02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from marshmallow import Schema, fields | |
class FooSchema(Schema): | |
author_name = fields.Nested('UserSerializer') | |
class Meta: | |
fields = ('id', 'author_name') | |
foos = Foo.query.all() | |
schema = FooSchema(many=True) | |
d = schema.dump(foos).data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment