How to implement followers/following in Django

后端 未结 2 496
北荒
北荒 2021-01-31 11:23

I want to implement the followers/following feature in my Django application.

I\'ve an UserProfile class for every User (django.contrib

2条回答
  •  情话喂你
    2021-01-31 11:48

    Set symmetrical to False in your Many2Many relation:

    follows = models.ManyToManyField('self', related_name='follows', symmetrical=False)
    

提交回复
热议问题