mongo.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:flask-restler 作者: klen 项目源码 文件源码
def __init__(self, cls):
        """Initialize the resource."""
        self._collection = None
        super(MongoOptions, self).__init__(cls)
        self.name = self.meta and getattr(self.meta, 'name', None)
        if not self.collection:
            return

        self.name = self.name or str(self.collection.name)

        if not cls.Schema:
            meta = type('Meta', (object,), self.schema_meta)
            cls.Schema = type(
                self.name.title() + 'Schema', (MongoSchema,), dict({'Meta': meta}, **self.schema))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号