#14645: Exclude query with multiple conditions for the same multi-value relation not correct -------------------------------------+------------------------------------- Reporter: Ben Buchwald | Owner: nobody <bb2@…> | Status: new Type: Bug | Version: master Component: Database layer | Resolution: (models, ORM) | Triage Stage: Accepted Severity: Normal | Needs documentation: 0 Keywords: exclude manytomany | Patch needs improvement: 0 Has patch: 0 | UI/UX: 0 Needs tests: 0 | Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by chriskrusz): Please note that this behaviour contradicts the documentation. According to the documentation (from [https://docs.djangoproject.com/en/1.5/topics/db/queries/#spanning-multi- valued-relationships]): "All of this behavior also applies to exclude(): all the conditions in a single exclude() statement apply to a single instance (if those conditions are talking about the same multi-valued relation). Conditions in subsequent filter() or exclude() calls that refer to the same relation may end up filtering on different linked objects." But exclude actually filters each condition on a different linked object. -- Ticket URL: <https://code.djangoproject.com/ticket/14645#comment:8> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.