1👍
✅
You can also reference using related_name
in the ManyToManyField
. It is more cleaner and easier to understand.
class Post(models.Model):
tag = models.ManyToManyField(Tag, related_name="post")
then you use it by
tag.post.all()
Source:stackexchange.com