| Age | Commit message (Collapse) | Author |
|
Thanks qcwxezdas for the report. Refs #13839.
|
|
Refs #9893, #18515.
Thanks Russell for the report.
|
|
Caused by regression fix for #19500.
|
|
The added promotion logic is based on promoting any joins used in only
some of the childs of an OR clause unless the join existed before the
OR clause addition.
|
|
The ORM didn't reuse joins for direct foreign key traversals when using
chained filters. For example:
qs.filter(fk__somefield=1).filter(fk__somefield=2))
produced two joins.
As a bonus, reverse onetoone filters can now reuse joins correctly
The regression was caused by the join() method refactor in commit
68847135bc9acb2c51c2d36797d0a85395f0cd35
Thanks for Simon Charette for spotting some issues with the first draft
of the patch.
|
|
This is necessary because get_model() checks are case insensitive, and if the swapable check isn't, the
swappable logic gets tied up in knots with models that are partially swapped out.
Thanks to chris@cogdon.org for the report and extensive analysis, and Preston for his work on the draft patch.
|
|
Conflicts:
django/db/models/loading.py
django/db/models/options.py
|
|
Thanks to Simon Charette for report.
|
|
|
|
This is a rather large refactoring. The "lookup traversal" code was
splitted out from the setup_joins. There is now names_to_path() method
which does the lookup traveling, the actual work of setup_joins() is
calling names_to_path() and then adding the joins found into the query.
As a side effect it was possible to remove the "process_extra"
functionality used by genric relations. This never worked for left
joins. Now the extra restriction is appended directly to the join
condition instead of the where clause.
To generate the extra condition we need to have the join field
available in the compiler. This has the side-effect that we need more
ugly code in Query.__getstate__ and __setstate__ as Field objects
aren't pickleable.
The join trimming code got a big change - now we trim all direct joins
and never trim reverse joins. This also fixes the problem in #10790
which was join trimming in null filter cases.
|
|
The trim argument was used by split_exclude() only to trim the last
join from the given lookup. It is cleaner to just trim the last part
from the lookup in split_exclude() directly so that there is no need
to burden add_filter() with the logic needed for only split_exclude().
|
|
The code was dead-code since 2006.
|
|
Thanks kujiu for the report and Aymeric Augustin for the review.
|
|
|
|
Reverse o2o fields are now usable with defer.
|
|
|
|
Thanks m3wolf for the report and akaariai for reproducing the problem.
|
|
|
|
swapped models.
Thanks to rizumu for the report.
|
|
F() expressions reuse joins like any lookup in a .filter() call -
reuse multijoins generated in the same .filter() call else generate
new joins. Also, lookups can now reuse joins generated by F().
This change is backwards incompatible, but it is required to prevent
dict randomization from generating different queries depending on
.filter() kwarg ordering. The new way is also more consistent in how
joins are reused.
|
|
The regression was caused by the fix for #13781 (commit
f51e409a5fb34020e170494320a421503689aea0). Reason was leaving
off some crucial lines when resolving a merge conflict.
|
|
The select_related code got confused when it needed to travel a
reverse relation to a model which had different parent than the
originally travelled relation.
Thanks to Trac aliases shauncutts for report and ungenio for original
patch (committed patch is somewhat modified version of that).
|
|
The problem is the same as in #10888 which was reintroduced when
bulk_insert was added. Thanks to Jani Tiainen for report, patch and
also testing the final patch on Oracle GIS.
|
|
The regression was caused by select_related fix for Oracle, commit
c159d9cec0baab7bbd04d5d51a92a51e354a722a.
|
|
This will have a smallish impact on performance. Refs #19276.
|
|
Thanks to Christian Oudard for the report and tests.
|
|
|
|
|
|
jgelens for the original patch.
|
|
for Python 2 object model compatibility methods.
|
|
This is the start of a deprecation path for the depth kwarg on
select_related. Removing this will allow us to update select_related so
it chains properly and have an API similar to prefetch_related.
Thanks to Marc Tamlyn for spearheading and initial patch.
refs #16855
|
|
The dupe avoidance logic was removed as it doesn't seem to do anything,
it is complicated, and it has nearly zero documentation.
The removal of dupe_avoidance allowed for refactoring of both the
implementation and signature of Query.join(). This refactoring cascades
again to some other parts. The most significant of them is the changes
in qs.combine(), and compiler.select_related_descent().
|
|
There was a potential data-loss issue involved -- when clearing
instance's m2m assignments it was possible some other instance's
m2m data was deleted instead.
This commit also improved None handling for to_field cases.
|
|
|
|
The Query.select and Query.select_fields were collapsed into one list
because the attributes had to be always in sync. Now that they are in
one attribute it is impossible to edit them out of sync.
Similar collapse was done for Query.related_select_cols and
Query.related_select_fields.
|
|
Conflicts:
django/db/backends/__init__.py
django/db/models/fields/related.py
django/db/models/options.py
|
|
Thanks to homm for the report and ramiro for the patch.
|
|
|
|
|
|
|
|
There was a bug introduced in #18676 which caused fast-path deletes
implemented as "DELETE WHERE pk IN <subquery>" to fail if the SELECT
clause contained additional stuff (for example extra() and annotate()).
Thanks to Trac alias pressureman for spotting this regression.
|
|
Added values() and values_list() methods to EmptyQuerySet.
|
|
Done for consistency with Q() expressions and QuerySet combining. This
will allow usage of '&' and '|' as boolean logical operators in the
future. Refs #16211.
|
|
This reverts commit 28abf5f0ebc9d380f25dd278d7ef4642c4504545.
Conflicts:
docs/releases/1.5.txt
|
|
RETURNING is an extension of the SQL standard, which is not implemented
the same by all databases. Allow DatabaseOperations.return_insert_id to
return a None to allow for other 3rd party backends with a different
implementation.
|
|
Thanks Preston Holmes.
|
|
Thanks David Hatch and Anssi Kääriäinen for their inputs.
|
|
This fixes a regression created by join promotion logic refactoring:
01b9c3d5193fe61b82ae8b26242a13fdec22f211
Thanks to Ivan Virabyan for the report.
|
|
Thanks to Preston Holmes for the suggestion.
|
|
|