1 | | Thanks Natalia, #27303 is effectively a manifestation of this problem in the admin. We don't have a good way to denote that joins against multi-valued relationships should be reused between different `QuerySet` method calls. It's a problem we hacked around for `filter` with this ''sticky'' notion but the problem exists for `annotate` and any other ORM method that allows for multi-valued (many-to-many or reverse one-to-many) to be referenced. I believe there are other tickets that discussed a generic way to alias such relationships so they are always reusable, I know it was brought up during the design of `FilteredRelation` for sure. |
| 1 | Thanks Natalia, #27303 is effectively a manifestation of this problem in the admin. We don't have a good way to denote that joins against multi-valued relationships should be reused between different `QuerySet` method calls. It's a problem we hacked around for `filter` with this ''sticky'' notion but the problem exists for `annotate` and any other ORM method that allows for multi-valued (many-to-many or reverse one-to-many) to be referenced. |
| 2 | |
| 3 | I believe there are other tickets that discussed a generic way to alias such relationships so they are always reusable, it was brought up during the design of `FilteredRelation` for sure. |