| Age | Commit message (Collapse) | Author |
|
|
|
The joins for nested nullable foreign keys were often created as INNER
when they should have been OUTER joins. The reason was that only the
first join in the chain was promoted correctly. There were also issues
with select_related etc.
The basic structure for this problem was:
A -[nullable]-> B -[nonnull]-> C
And the basic problem was that the A->B join was correctly LOUTER,
the B->C join not.
The major change taken in this patch is that now if we promote a join
A->B, we will automatically promote joins B->X for all X in the query.
Also, we now make sure there aren't ever join chains like:
a LOUTER b INNER c
If the a -> b needs to be LOUTER, then the INNER at the end of the
chain will cancel the LOUTER join and we have a broken query.
Sebastian reported this problem and did also major portions of the
patch.
|
|
|
|
Fixed #18837. Refs #18791.
|
|
This reverts commit 3fce0d2a9162cf6e749a6de0b18890dea8955e89.
|
|
The ORM generated a query with INNER JOIN instead of LEFT OUTER JOIN
in a somewhat complicated case. The main issue was that there was a
chain of nullable FK -> non-nullble FK, and the join promotion logic
didn't see the need to promote the non-nullable FK even if the
previous nullable FK was already promoted to LOUTER JOIN. This resulted
in a query like a LOUTER b INNER c, which incorrectly prunes results.
|
|
|
|
Thanks guettli and mrmachine.
|
|
|
|
Backwards compatibility aliases were created under Python 2.
|
|
|
|
|
|
|
|
|
|
This commit fixes the auto-reload of the development server.
I should have done that change in ca07fda2.
|
|
|
|
Complementary to commit 62a9ed0ac.
|
|
|
|
|
|
|
|
|
|
In Python 3 dividing by int will call obj.__truediv__(). This operator
was missing from F-expressions.
|
|
Also changed several occurrences of 'request' to 'response'.
|
|
This is more idiomatic and avoids returning a list on Python 2 and
an iterator on Python 3.
|
|
when computing the length of a dictionary. This fails on Python 3.
|
|
Fixed a regression introduced in 59a655988ee95e4b4e4646cebea88b620d8fcdd2.
|
|
Deferred models now automatically update only the fields which are
loaded from the db (with .only() or .defer()). In addition, any field
set manually after the load is updated on save.
|
|
This patch removes an unconditional float(value) conversion from db
backend default convert_values() method. This can cause problems when
aggregating over character fields for example. In addition, Oracle
and SQLite already return the bare value from their convert_values().
In the long term the converting should be done by fields, and the
fields should then call database backend specific converters when
needed. The current setup is inflexible for 3rd party fields.
Thanks to Merlijn van Deen for the original patch.
|
|
Thanks Aymeric Augustin for the review.
|
|
|
|
The outer query's set of reusable joins (can_reuse) was passed to the
inner query's add_filter call. This was incorrect.
|
|
* Renamed the __unicode__ methods
* Applied the python_2_unicode_compatible decorator
* Removed the StrAndUnicode mix-in that is superseded by
python_2_unicode_compatible
* Kept the __unicode__ methods in classes that specifically
test it under Python 2
|
|
These methods actually return unicode.
|
|
on Python 3.
|
|
reraise with second argument to None is not supported.
|
|
|
|
|
|
|
|
See PEP 3114. `next` is retained as an alias for Python 2.
|
|
The six addition has been borrowed from:
https://bitbucket.org/gutworth/six/changeset/733ef740
|
|
|
|
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
|
|
|
|
|
|
* Renamed smart_unicode to smart_text (but kept the old name under
Python 2 for backwards compatibility).
* Renamed smart_str to smart_bytes.
* Re-introduced smart_str as an alias for smart_text under Python 3
and smart_bytes under Python 2 (which is backwards compatible).
Thus smart_str always returns a str objects.
* Used the new smart_str in a few places where both Python 2 and 3
want a str.
|
|
|
|
|
|
This is a useful trick when Python 2 awaits byte strings and
Python 3 Unicode (regular) strings.
|
|
|
|
Conflicts:
django/db/backends/postgresql_psycopg2/base.py
|