#7872: Some complex lookups with Q objects (or-style) don't return all matching
model objects.
----------------------------------------------+-----------------------------
Reporter: [EMAIL PROTECTED] | Owner: mtredinnick
Status: reopened | Milestone: 1.0
Component: Database wrapper | Version: SVN
Resolution: | Keywords:
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
----------------------------------------------+-----------------------------
Comment (by mir):
If you don't use Q objects, you get the expected behaviour, i.e.:
{{{
t6 =
(SupportTicket.objects.filter(assignment_made__group_assigned__user=u) |
SupportTicket.objects.filter(created_by__parent__parent=u)).distinct()
}}}
(At least this worked in my test case.)
I recall remotely that there's a subtle semantic difference when you use Q
objects: It means that all the conditions must apply to the same object.
It should not apply here in my opinion, but I'm not really sure. Malcolm?
--
Ticket URL: <http://code.djangoproject.com/ticket/7872#comment:7>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---