This ticket deals with problems of doing
`Author.objects.exclude(friends__age__gte=20, friends__age__lte=40)`.
Currently this creates two joins to friends, so that any author with
either a friend older than 20 or a friend younger than 40 is matched. The
correct interpretation is that any author with a friend with age between
20 and 40 is matched.
--
Ticket URL: <https://code.djangoproject.com/ticket/25991>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by akaariai):
Related tickets:
- https://code.djangoproject.com/ticket/14645
- https://code.djangoproject.com/ticket/18726
- https://code.djangoproject.com/ticket/21703
- https://code.djangoproject.com/ticket/23797
- https://code.djangoproject.com/ticket/24386
The first one (#14645) deals with the issue mentioned in this ticket's
description. It should be fixed by this ticket. The rest of the tickets
are various failures in .exclude() queries, and these might be fixed by
this ticket, but I haven't verified those yet.
--
Ticket URL: <https://code.djangoproject.com/ticket/25991#comment:1>
* cc: carsten.fuchs@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/25991#comment:2>
* needs_better_patch: 0 => 1
Comment:
As Ansii noted on the pull request, "I still found some cases that do not
work the way they should. So, this needs a bit more work...".
--
Ticket URL: <https://code.djangoproject.com/ticket/25991#comment:3>