This required implementing a limited form of dynamic dispatch to combine
expressions with numerical output. Refs #26355 should eventually provide
a better interface for that.
Previously unresolved Value() instances were only allowed to be
compiled if they weren't initialized with an output_field.
Given the usage of unresolved Value() instances is relatively common in
as_sql() overrides it's less controversial to add explicit support for
this previously undefined behavior now and revisit whether or not it
should be deprecated in the future.
The subtract_temporals() database operation was not handling expressions
returning SQL params in mixed database types.
Regression in 35431298226165986ad07e91f9d3aca721ff38ec.
Thanks Reupen Shah for the report.
Thanks Dmitriy Gunchenko for the report and Simon Charette for the
analysis and tests.
Regression in 5a4d7285bd10bd40d9f7e574a7c421eb21094858.
Fixed in 5a4d7285bd10bd40d9f7e574a7c421eb21094858.
Changed __eq__ to return NotImplemented instead of False if compared to
an object of the same type, as is recommended by the Python data model
reference. Now these models can be compared to ANY (or other objects
with __eq__ overwritten) without returning False automatically.
This allows using expressions that have an output_field that is a
BooleanField to be used directly in a queryset filters, or in the
When() clauses of a Case() expression.
Thanks Josh Smeaton, Tim Graham, Simon Charette, Mariusz Felisiak, and
Adam Johnson for reviews.
Co-Authored-By: NyanKiyoshi <hello@vanille.bid>
Expressions referring to different bound fields should not be
considered equal.
Thanks Julien Enselme for the detailed report.
Regression in bc7e288ca9554ac1a0a19941302dea19df1acd21.
The old implementation considered objects initialized with an equivalent
signature different if some arguments were provided positionally instead of
as keyword arguments.
Refs #11964, #26167.
The Subquery class which Exists inherits from defaulted to using single-valued
querie's field if no output_field was explicitly specified on initialization
which was bypassing the Exists.output_field defined at the class level.
Moving Subquery's dynamic output_field resolution to _resolve_output_field
should make sure the fallback logic is only performed if required.
Regression in 08654a99bbdd09049d682ae57cc94241534b29f0.
Thanks Oli Warner for the detailed report.