How to set default value of foreign key pointing to self?

后端 未结 0 978
一向
一向 2021-01-18 06:21

models.py

class Person(models.Model):
     (...)
     leader = models.ForeignKey("self", on_delete=models.RESTRICT, related_name =\'leader_set\')


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