I read the django documentation and I found something confusing! https://docs.djangoproject.com/en/3.2/topics/db/queries/#spanning-multi-valued-relationships.
It is stated that "When you are filtering an object based on a ManyToManyField or a reverse ForeignKey, there are two different sorts of filter you may be interested in"
"To select all blogs that contain entries with both “Lennon” in the headline and that were published in 2008 (the same entry satisfying both conditions), we would write:"
Blog.objects.filter(entry__headline__contains='Lennon', entry__pub_date__year=2008)
"To select all blogs that contain an entry with “Lennon” in the headline as well as an entry that was published in 2008, we would write:"
Blog.objects.filter(entry__headline__contains='Lennon').filter(entry__pub_date__year=2008)
"Suppose there is only one blog that had both entries containing “Lennon” and entries from 2008, but that none of the entries from 2008 contained “Lennon”. The first query would not return any blogs, but the second query would return that one blog"
So, by reading this guide, multiple questions have been created in my mind:
1- What is difference between these two types of filtering? what I know is that both of them must return blogs that contain both 'Lennon' in headline and was published in 2008. I can't find out the point.
2- The Document says this rule is just for ManyToManyField or a reverse ForeignKey. The question is, Why?