Changes between Initial Version and Version 2 of Ticket #20127
- Timestamp:
- Oct 8, 2015, 6:22:14 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #20127
- Property Triage Stage Unreviewed → Accepted
-
Ticket #20127 – Description
initial v2 1 There are some different ways for doing subqueries in the ORM currently. Query.split_exclude(), subqueries in deletion, as_nested_sql() and SubqueryConstraintseem to do something similar. Sometimes there are duplicated code paths, sometimes upper layers do something the lower layers will repeat later on.1 There are some different ways for doing subqueries in the ORM currently. `Query.split_exclude()`, subqueries in deletion, `as_nested_sql()` and `SubqueryConstraint` seem to do something similar. Sometimes there are duplicated code paths, sometimes upper layers do something the lower layers will repeat later on. 2 2 3 I think every instance where a subquery constrain is needed should use the SubqueryConstraint either directly, or through QuerySet.filter() or sql.Query.build_filter(). This will allow doing all the somewhat complicated setup in one place.3 I think every instance where a subquery constraint is needed should use the `SubqueryConstraint` class either directly, or through `QuerySet.filter()` or `sql.Query.build_filter()`. This will allow doing all the somewhat complicated setup in one place.