Now, when using Django's admin panel, a user will (wrongly) always show up
in `follows` as reference to itself. This reference has nothing to do with
the database, there is no entry in the relation table.
This should serve as a little reproducable example:
{{{
class Followable(models.Model):
# This is necessary to prevent doubled id name in `User`
followable_id = models.BigAutoField(primary_key=True)
class User(Followable):
alias = models.CharField(max_length=32)
follows = models.ManyToManyField(Followable, blank=True,
related_name="followed_by")
User(alias="foo_user").save()
user = User.objects.get(alias="foo_user")
assert len(user.follows) == 0
}}}
If this is a known issue, I apologize. I wasn't able to find posts
addressing this issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/34897>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
I'm sorry, I didn't understand the admin UI properly. You can just ignore
this.
--
Ticket URL: <https://code.djangoproject.com/ticket/34897#comment:1>