How can I save a model instance that references itself in django?

后端 未结 0 1390
不知归路
不知归路 2020-11-28 05:52

I have the following code:

from django.db import models

class MyModel(models.Model):
    parent = models.ForeignKey(\'self\', on_delete=models.CASCADE, relat         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题