【发布时间】:2017-02-25 10:08:07
【问题描述】:
在 Django 模型中,我正在制作一个“追随者”表,其中包含:
user's id. (this is followed by)
user's id (this is follower)
用户可以关注其他用户,这很简单。
我应该如何在 Django 中定义模型?
我试过了,但不起作用:
user = models.ForeignKey('self')
follower_id = models.ForeignKey('self')
这应该怎么做?
谢谢
【问题讨论】:
标签: django postgresql model psql