| Age | Commit message (Collapse) | Author |
|
ManyToManyField was already excluded from fields, concrete_fields,
and local_concrete_fields in Options.
Backport of f9a44cc0fac653f8e0c2ab1cdfb12b2cc5c63fc2 from main
|
|
annotations.
MySQL only supports the ->> when used directly against columns, this can be
inferred by the presence of lhs.output_field.model as model bounds fields are
directly tied to columns.
Purposely don't systematically switch to using JSON_QUOTE(JSON_EXTRACT(...))
as there might be functional indices out there that rely on the SQL remaining
stable between versions.
Thanks Jacob Tavener for the report.
Backport of af84cfba5970fda8306860b650937701c7c03c6f from main.
|
|
This required implementing UPDATE RETURNING machinery that heavily
borrows from the INSERT one.
|
|
|
|
Previously save() would crash with an attempted forced update message, and both
save(force_insert=True) and bulk_create() would crash with DoesNotExist errors
trying to retrieve rows with an empty primary key (id IS NULL).
Implementing deferred field model instance copying might be doable in certain
cases (e.g. when all the deferred fields are db generated) but that's not
trivial to implement in a backward compatible way.
Thanks Adam Sołtysik for the report and test and Clifford for the review.
|
|
|
|
|
|
https://github.com/psf/black/releases/tag/25.1.0
|
|
|
|
databases that don't support primitives in JSONFields.
For example on Oracle < 21c.
|
|
Avoids reports of bulk_update() sending Cast expressions
to JSONField.get_prep_value().
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
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.
|
|
|
|
timeline.
|
|
The previous logic was systematically attempting to retrieve last_insert_id
even for models without an AutoField primary key when they had a GeneratedField
on backends that can't return columns from INSERT.
The issue affected MySQL, SQLite < 3.35, and Oracle when the use_returning_into
option was disabled and could result in either crashes when the non-auto
primary key wasn't an IntegerField subclass or silent misassignment of bogus
insert ids (0 or the previous auto primary key insert value) to the first
defined generated field value.
|
|
DatabaseOperations.adapt_decimalfield_value().
Regression in e9814029f570bd0866dc859147bca90340bcc913.
Thanks Simon Charette for advice and review.
|
|
usage on Oracle.
Thanks Seokchan Yoon for the report, and Mariusz Felisiak and Sarah
Boyce for the reviews.
|
|
|
|
|
|
FieldCacheMixin.get_cache_name().
|
|
directory in model_fields tests.
|
|
GeneratedModelUniqueConstraint.
|
|
Accessing generated field values on unsaved models caused a crash when
validating CheckConstraints and UniqueConstraints with expressions.
|
|
|
|
|
|
FieldCacheMixin.
FieldCacheMixin is used by related fields to track their cached values.
This work migrates get_cache_name() to be a cached property to optimize
performance by reducing unnecessary function calls when working with
related fields, given that its value remains constant.
Co-authored-by: Simon Charette <charette.s@gmail.com>
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
|
|
FileField.
|
|
Thanks Matt Hegarty for the report and Simon Charette and Natalia Bidart for the reviews.
Regression in f333e35.
|
|
GeneratedFields in aliased tables.
Thanks Simon Charette for the review.
|
|
|
|
Thanks Claude Paroz for the report.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
|
|
ForeignKeys.
Thanks Deb Kumar Das for the report.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
GeneratedField.output_field with backend converters.
Regression in d9de74141e8a920940f1b91ed0a3ccb835b55729.
This is a long standing issue, however it caused a crash of
GeneratedFields for all output fields that have backend-specific
converters when the RETURNING clause is not supported
(MySQL and SQLite < 3.35).
That's why severity was exacerbated.
|
|
are not populated.
Thanks Paolo Melchiorre for the report.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
CockroachDB and Snowflake don't support it.
|
|
output_field with params.
|
|
DatabaseFeatures.nulls_order_largest=False.
Failure observed on CockroachDB.
|
|
Test regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
|
|
JSONField & co.
Per deprecation timeline.
|
|
|
|
Thanks Simon Charette for the implementation idea.
|
|
|
|
Thanks Adam Johnson and Paolo Melchiorre for reviews.
Co-Authored-By: Lily Foote <code@lilyf.org>
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
ChoiceField's choices.
|
|
|
|
without width/height fields.
This avoids reading the image size when the dimensions fields
(image_width, image_height) do not exist, as that operation may be
expensive.
Partially reverts ea53e7c09f1b8864c20c65976bbeaeab77abdaec, that dropped
the check for the dimension fields in update_dimension_fields(), because
the post_init signal was no longer registered without dimension fields.
However, another code path to that function exists: when the
ImageFileField is save()d, the name from the storage is setattr()ed on
the field, and ImageFileDescriptor calls update_dimension_fields()
because the image size might have changed. Keep bailing out early when
dimensions are unused.
Besides, computing the image dimensions causes to close() the file,
resulting in a backward-incompatible change. The test protects against
that change.
|
|
values to decimal."
This reverts 7990d254b0af158baf827fafbd90fe8e890f23bd.
Thanks Marc Odermatt for the report.
|
|
Regression in 5c23d9f0c32f166c81ecb6f3f01d5077a6084318.
|