How to filter foreignkey pointing to self

前端 未结 0 1674
攒了一身酷
攒了一身酷 2021-01-18 05:50

models.py:

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


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