class MapperBase(Mapper): __type__ = TestType id = Integer() name = String() users = Collection(Nested(UserMapper, allow_create=True))
class MapperBase(Mapper): __type__ = TestType id = Integer() name = String() user = Nested(UserMapper, null_default={})
class UserMapper(Mapper): __type__ = dict id = String(required=True, read_only=True) name = String() company = Nested(CompanyMapper)
class MapperBase(Mapper): __type__ = TestType id = Integer() name = String() user = Nested(UserMapper, role='private') __roles__ = {'private': whitelist('name', 'user')}
class MapperBase(Mapper): __type__ = TestType id = Integer() name = String() user = Nested(UserMapper, role='private') __roles__ = { 'private': [ 'id', ] }