一对一级联数据表,on_delete='CASCADE'删除主表时从表信息不自动删除报错'str' object is not callable
一对一级联数据表,on_delete='CASCADE'删除主表时从表信息不自动删除报错'str' object is not callable
问题已解决
错误写法:
card_person = models.OneToOneField(Person, on_delete=‘CASCADE’, null=True, blank=True)
正确写法:
card_person = models.OneToOneField(Person, on_delete=models.CASCADE, null=True, blank=True)