Allowing Q Objects to select between OUTER and INNER joins (semi-intelligently)
|Reported by:||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Severity:||Keywords:||Q, QuerySet, JOINs qset_refactor, qs-rf-fixed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
I would like my Q objects to use LEFT OUTER JOIN or INNER JOIN depending on whether or not one is better than the other. e.g. if I do x & y I probably want INNER JOIN, but if I do x | y, I think the DEFAULT behavior should be an OUTER JOIN if there are any foreign key lookups.
While I do believe a complete QuerySet Refactoring is in order, I feel as though the simplicity and the great default behavior that Q objects offer is nice to have, and that this patch will improve the default behavior tremendously.
Change History (23)
comment:5 follow-up: 6 Changed 10 years ago by
|Owner:||changed from Adrian Holovaty to Malcolm Tredinnick|
|Patch needs improvement:||unset|
|Triage Stage:||Design decision needed → Accepted|