schema.py 文件源码

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

项目:aiohttp_json_api 作者: vovanbo 项目源码 文件源码
def _sp_to_field(mcs, fields):
        """
        Returns an ordered dictionary, which maps the source pointer of a
        field to the field. Nested fields are listed before the parent.
        """
        from aiohttp_json_api.fields.base import Relationship

        result = OrderedDict()
        for field in fields:
            if isinstance(field, Relationship):
                result.update(mcs._sp_to_field(field.links.values()))
            result[field.sp] = field
        return MappingProxyType(result)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号