[Answered ]-For Django recursive ManytoManyFields, can related_name override symmetrical=False?

2๐Ÿ‘

โœ…

If I understand correctly, I think you should have something like:

authors_followed = models.ManytoManyField('self', related_name='following_authors', null=True, through='FollowedAuthors', symmetrical=False)

That way,

MyAuthor.following_authors.all()

will return the authors that are following MyAuthor, and

MyAuthor.author_followed.all()

will return the authors that MyAuthor is following.

With your configuration, Django is not able to make the difference and identify the direction you want.

๐Ÿ‘คArthur

Leave a comment