At least Oracle needs parentheses in negated where conditions, even if
there is only single condition negated. Fixed this by reverting to old
logic in that part of as_sql() and adding a comment about this.
I did not investigate why the parentheses are needed. The original
offending commit was bd283aa844.
When the postgresql_psycopg2 backend was used with DB-level autocommit
mode enabled, after entering transaction management and then leaving
it, the isolation level was never set back to autocommit mode.
Thanks brodie for report and working on this issue.
Made sure the WhereNode.as_sql() handles various EmptyResultSet and
FullResultSet conditions correctly. Also, got rid of the FullResultSet
exception class. It is now represented by '', [] return value in the
as_sql() methods.
This commit tackles a couple of issues. First, in certain cases there
were some mixups if field.attname or field.name should be deferred.
Field.attname is now always used.
Another issue tackled is a case where field is both deferred by
.only(), and selected by select_related. This case is now an error.
A lot of thanks to koniiiik (Michal Petrucha) for the patch, and
to Andrei Antoukh for review.
Added ability to use receiver decorator in the following way:
@receiver([post_save, post_delete], sender=MyModel)
def signals_receiver(sender, **kwargs):
...
Previously, the closing token for the verbatim tag was specified as the
first argument of the opening token. As pointed out by Jannis, this is
a rather major departure from the core tag standard.
The new method reflects how you can give a specific closing name to
{% block %} tags.
In addition, removed a possibly problematic .filter() call from
backends.test_query_encoding test. It is possible the .filter could
cause collation problems on MySQL, and as it wasn't absolutely needed
for the test it seemed better to get rid of the call.
Refs #18461.
Connection.features does not need to be confirmed any more, after
commit aa42357, rendering obsolete the workaround when using
TEST_MIRROR (Refs #16885, #17760).
This does remove the requirement to call features.confirm() method
before checking the properties.
Thanks cdestiger and Ramiro Morales for their work on the patch.
Generic views assumed any object's _meta will be model Options. This
is not true for ModelForms for example. Took isinstance(obj, Model)
in use instead.
Fixed#18381 -- Stopped escaping object ids
when passing them to the contenttypes.shortcut view.
Thanks apollo13 for the patch and dhepper for the review.
On MySQL when checking the server version, a new connection could be
created but never closed. This could result in open connections on
server startup.
When order_by causes new joins to be added to the query, the joins must
be LEFT OUTER joins for nullable relations, otherwise the order_by
could cause the results to be altered. This commit fixes the logic to
only promote new joins, previously all joins in the order_by lookup
path were promoted.
Thanks to Bruno Desthuilliers for spotting this corner case.
A test in model_fields used LEN() in raw SQL. This function is not
available on some 3rd party backends. I removed this function and
ensured that the test works correctly (breaks pre e9bbdb39de) with
the change.
after the full file name is generated by the storage class.
Thanks Refefer for the report, carsongee for the patch, and
everyone else involved in the discussion.
Fixed#18248 -- proxy models were added to included_inherited_models
in sql.query.Query. The variable is meant to be used for multitable
inheritance only. This mistake caused problems in situations where
proxy model's query was reused.
Introduced a distinct implementation depending on the type of the
date field (DateField or DateTimeField), and applied appropriate
conversions is the latter case, when time zone support is enabled.
Fixed#18175 -- Calling SortedDict.__copy__() resulted in changes to
the original dictionary. The reason was likely related to subclassing
dict.
Thanks to linovia for report and patch.
Fixed#15933, #18082 -- the get_indexes() method introspection was
done inconsitently depending on the backend. For example SQLite
included all the columns in the table in the returned dictionary,
while MySQL introspected also multicolumn indexes.
All backends return now consistenly only single-column indexes.
Thanks to andi for the MySQL report, and ikelly for comments on
Oracle's get_indexes() changes.
Fixed#17957 -- when using Oracle and character fields, the fields
were set null = True to ease the handling of empty strings. This
caused problems when using multiple databases from different vendors,
or when the character field happened to be also a primary key.
The handling was changed so that NOT NULL is not emitted on Oracle
even if field.null = False, and field.null is not touched otherwise.
Thanks to bhuztez for the report, ramiro for triaging & comments,
ikelly for the patch and alex for reviewing.
QuerySet had previously some complex logic for dealing with nullable
fields in negated add_filter() calls. It seems the logic is leftover
from a time where the WhereNode wasn't as intelligent in handling
field__in=[] conditions.
Thanks to aaugustin for comments on the patch.