开发者

Django: how to prevent parent object to be deleted when deleting its child object

Class A(models.Model):
    name = models.CharField()

Class B(A):
    extra_info = models.CharField()

When I delete an B object, its parent obje开发者_如何学Pythonct A also gets deleted, how to solve this headache, thanks very much. I'm using Django 1.2.3


This isn't possible really in Django 1.2, but it is in Django 1.3, using on_delete.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜