我正在为Django项目执行以下系统。 models.py:
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
followers = models.ManyToManyField('self', symmetrical=False, blank=True, related_name='followers_profile')
following = models.ManyToManyField('self', symmetrical=False, blank=True, related_name='following_profile')
biography = models.TextField(max_length=500, blank=True, null=True)
profile_picture = models.ImageField(blank=True, null=True)
def __str__(self):
return self.user.username
我想知道是否可以仅通过关注者字段来做到这一点。