| Age | Commit message (Collapse) | Author |
|
output_field.
When Expression.__init__() overrides make use of *args, **kwargs
captures their argument values are respectively bound as a tuple and
dict instances. These composite values might themselves contain values
that require special identity treatments such as Concat(output_field)
as it's a Field instance.
Refs #30628 which introduced bound Field differentiation but lacked
argument captures handling.
Thanks erchenstein for the report.
Backport of df2c4952df6d93c575fb8a3c853dc9d4c2449f36 from main
|
|
In order for Expression.relabeled_clone to work appropriately its
get_source_expressions method must return all resolvable which wasn't the case
for Lookup when its right-hand-side is "direct" (not a compilable).
While refs #22288 added support for non-literals iterable right-hand-side
lookups it predated the subclassing of Lookup(Expression) refs #27021 which
could have been an opportunity to ensure right-hand-sides are always resolvable
(ValueList and ExpressionList).
Addressing all edge case with non-resolvable right-hand-sides would require
a significant refactor and deprecation of some parts of the Lookup interface so
this patch only focuses on FieldGetDbPrepValueIterableMixin (In and Range
lookups) by making sure that a right-hand-side containing resolvables are dealt
with appropriately during the resolving phase.
Thanks Aashay Amballi for the report.
Backport of 089deb82b9ac2d002af36fd36f288368cdac4b53 from main.
|
|
Backport of cbb0812683cf3236e4a4003bf7f74b119d3cde0c from main.
|
|
|
|
This also caused un-ordered sliced prefetches to crash as they rely on Window.
Regression in e16d0c176e9b89628cdec5e58c418378c4a2436a that made OrderByList
piggy-back ExpressionList without porting the empty handling that the latter
provided.
Supporting explicit empty ordering on Window functions and slicing is arguably
a foot-gun design due to how backends will return undeterministic results but
this is a problem that requires a larger discussion.
Refs #35064.
Thanks Andrew Backer for the report and Mariusz for the review.
|
|
against JSON fields.
Thanks Eyal (eyalgabay) for the report.
|
|
BasicExpressionsTests._test_slicing_of_f_expressions() subtests.
Thanks Tim Graham for the report.
|
|
Regression in 94b6f101f7dc363a8e71593570b17527dbb9f77f.
|
|
tests models.
|
|
with OpClass().
This also introduces Expression.constraint_validation_compatible that
allows specifying that expression should be ignored during a constraint
validation.
|
|
IntegerField/DecimalField with NULL.
|
|
https://github.com/psf/black/releases/tag/24.1.0
|
|
and MySQL.
Also removed tests that ensured that adapt_(date)timefield backend
operations where able to deal with expressions when it's not the case
for any other adapt methods.
|
|
|
|
Co-authored-by: Priyansh Saxena <askpriyansh@gmail.com>
Co-authored-by: Niclas Olofsson <n@niclasolofsson.se>
Co-authored-by: David Smith <smithdc@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Abhinav Yadav <abhinav.sny.2002@gmail.com>
|
|
with string Value()."
This reverts commit 8b1acc0440418ac8f45ba48e2dfcf5126c83341b.
|
|
string Value().
This should allow smarter output_field inferring in functions dealing
with text expressions.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
empty queryset.
Thanks Tobias Bengfort for the report.
|
|
Regression in 40b8a6174f001a310aa33f7880db0efeeb04d4c4.
|
|
OuterRef annotations.
Thanks Pierre-Nicolas Rigal for the report.
Regression in c67ea79aa981ae82595d89f8018a41fcd842e7c9.
|
|
|
|
when nulls_first/nulls_last=False is passed.
Per deprecation timeline.
|
|
Fixed in 35431298226165986ad07e91f9d3aca721ff38ec.
|
|
|
|
assertQuerySetEqual().
Co-Authored-By: Michael Howitz <mh@gocept.com>
|
|
Recent refactors allowed GROUP BY aliasing allowed for aliasing to be
entirely handled by the sql.Query.set_group_by and compiler layers.
|
|
MOD operator.
|
|
and Expression.asc()/desc().
Thanks Allen Jonathan David for the initial patch.
|
|
It accounts for differences seen on MySQL with MyISAM storage engine.
|
|
extra() against SQL injection in column aliases.
Thanks Splunk team: Preston Elder, Jacob Davis, Jacob Moore,
Matt Hanson, David Briggs, and a security researcher: Danylo Dmytriiev
(DDV_UA) for the report.
|
|
DateField/DateTimeField/TimeField/DurationFields.
This includes refactoring of CombinedExpression._resolve_output_field()
so it no longer uses the behavior inherited from Expression of guessing
same output type if argument types match, and instead we explicitly
define the output type of all supported operations.
This also makes nonsensical operations involving dates
(e.g. date + date) raise a FieldError, and adds support for
automatically inferring output_field for cases such as:
* date - date
* date + duration
* date - duration
* time + duration
* time - time
|
|
CombinedExpression.
|
|
|
|
|
|
|
|
Exists() with empty queryset.
Regression in b7d1da5a62fe4141beff2bfea565f7ef0038c94c.
|
|
In these cases Black produces unexpected results, e.g.
def make_random_password(
self,
length=10,
allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789',
):
or
cursor.execute("""
SELECT ...
""",
[table name],
)
|
|
queryset.
Thanks Tobias Bengfort for the report.
|
|
|
|
|
|
Value.output_field for strings.
This brings the behaviour in line with Field subclasses which append to
the validators within __init__(), like BinaryField, and prevents the
creation of a validator which incorrectly throws a TypeError, if it
were used.
|
|
Value.output_field.
|
|
null values.
|
|
SQLite.
|
|
DatabaseFeatures.supports_mixed_date_datetime_comparisons.
|
|
test_in_lookup_allows_F_expressions_and_expressions_for_datetimes().
|
|
|
|
DecimalFields on MySQL.
Regression in 1e38f1191de21b6e96736f58df57dfb851a28c1f.
Thanks Mohsen Tamiz for the report.
|
|
|
|
|