fields.py 文件源码

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

项目:django-composite-foreignkey 作者: onysos 项目源码 文件源码
def _check_recursion_field_dependecy(self):
        res = []
        for local_field in self._raw_fields.values():
            try:
                f = self.model._meta.get_field(local_field.value)
                if isinstance(f, CompositeForeignKey):
                    res.append(
                        checks.Error(
                            "the field %s depend on the field %s which is another CompositeForeignKey" % (self.name, local_field),
                            hint=None,
                            obj=self,
                            id='compositefk.E005',
                        )
                    )
            except FieldDoesNotExist:
                pass  # _check_to_fields_local_valide already raise errors for this
        return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号