convert.py 文件源码

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

项目:QualquerMerdaAPI 作者: tiagovizoto 项目源码 文件源码
def property2field(self, prop, instance=True, field_class=None, **kwargs):
        field_class = field_class or self._get_field_class_for_property(prop)
        if not instance:
            return field_class
        field_kwargs = self._get_field_kwargs_for_property(prop)
        field_kwargs.update(kwargs)
        ret = field_class(**field_kwargs)
        if (
            hasattr(prop, 'direction') and
            self.DIRECTION_MAPPING[prop.direction.name] and
            prop.uselist is True
        ):
            ret = fields.List(ret, **kwargs)
        return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号