#16172: Filtering queryset using Q objects to find objects with two specific values on the same many:many relationship returns 0 results -------------------------------------+------------------------------------- Reporter: | Owner: nobody mpdaugherty | Status: closed Type: Bug | Component: Database layer Milestone: | (models, ORM) Version: 1.3 | Severity: Normal Resolution: invalid | Keywords: Triage Stage: | Has patch: 0 Unreviewed | Needs tests: 0 Needs documentation: 0 | Easy pickings: 0 Patch needs improvement: 0 | UI/UX: 0 | -------------------------------------+------------------------------------- Changes (by mpdaugherty):
* ui_ux: => 0 Comment: Thanks, kmtracey. I just came back to write the same thing; after finding that the Django unit tests specifically check for the behavior I thought was a bug, I reread https://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi- valued-relationships in more detail and finally understood the design decision. I'm working on a project that gives users the ability to create arbitrary queries through the data, so our initial approach was to create a UI for this and then serialize their queries into Q objects. However, it sounds like we'll have to do something more complex, because not every query can be expressed as a single .filter(Q) expression. -- Ticket URL: <https://code.djangoproject.com/ticket/16172#comment:2> Django <https://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 django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.