types.py 文件源码

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

项目:graphene-django 作者: graphql-python 项目源码 文件源码
def is_type_of(cls, root, info):
        if isinstance(root, SimpleLazyObject):
            root._setup()
            root = root._wrapped
        if isinstance(root, cls):
            return True
        if not is_valid_django_model(type(root)):
            raise Exception((
                'Received incompatible instance "{}".'
            ).format(root))
        model = root._meta.model
        return model == cls._meta.model
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号