我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用marshmallow.SchemaOpts()。
def __init__(self, meta): super(SchemaOpts, self).__init__(meta) self.model = getattr(meta, 'model', None) self.dump_only_pk = getattr(meta, 'dump_only_pk', True) if self.model and not issubclass(self.model, pw.Model): raise ValueError("`model` must be a subclass of peewee.Model") self.model_converter = getattr(meta, 'model_converter', ModelConverter)