summaryrefslogtreecommitdiff
path: root/django
AgeCommit message (Collapse)Author
2025-03-05Fixed typo in django/db/backends/postgresql/psycopg_any.py comment.Jacob Walls
2025-03-04Fixed #36217 -- Restored pre_save/post_save signal emission via ↵antoliny0919
LogEntry.save() for single-object deletion in the admin. Regression in 40b3975e7d3e1464a733c69171ad7d38f8814280. Thanks smiling-watermelon for the report. Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2025-03-03Refs #35444 -- Deprecated contrib.postgres.OrderableAggMixin.Chris Muthig
This commit does not create any functional changes, but marks the existing `OrderableAggMixin` class as deprecated so that developers using it directly can be made aware of its future removal.
2025-03-03Fixed #35444 -- Added generic support for Aggregate.order_by.Chris Muthig
This moves the behaviors of `order_by` used in Postgres aggregates into the `Aggregate` class. This allows for creating aggregate functions that support this behavior across all database engines. This is shown by moving the `StringAgg` class into the shared `aggregates` module and adding support for all databases. The Postgres `StringAgg` class is now a thin wrapper on the new shared `StringAgg` class. Thank you Simon Charette for the review.
2025-03-01Fixed #36198 -- Implemented unresolved transform expression replacement.Simon Charette
This allows the proper resolving of F("field__transform") when performing constraint validation. Thanks Tom Hall for the report and Sarah for the test.
2025-03-01Applied Black's 2025 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/25.1.0
2025-02-24Fixed #36186 -- Added forloop.length variable within a template for loop.Jonathan Ströbele
2025-02-23Fixed #35705 -- Added Rotate GIS database function to rotate geometries.enprava
2025-02-22Fixed #35839 -- Fixed crash when adding GeneratedField with db_comment on MySQL.saJaeHyukc
Thanks Simon Charette for the test. Signed-off-by: saJaeHyukc <wogur981208@gmail.com>
2025-02-19Fixed #35358, Refs #35234 -- Renamed _check() methods to check() for ↵Mariusz Felisiak
constraints.
2025-02-18Fixed #35167 -- Delegated to super() in JSONField.get_db_prep_save().Jacob Walls
Avoids reports of bulk_update() sending Cast expressions to JSONField.get_prep_value(). Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-02-18Fixed #36197 -- Fixed improper many-to-many count() and exists() for non-pk ↵Simon Charette
to_field. Regression in 66e47ac69a7e71cf32eee312d05668d8f1ba24bb. Thanks mfontana-elem for the report and Sarah for the tests.
2025-02-18Fixed #31170 -- Added change event trigger to dismissRelatedLookupPopup.Кайрат Макым
2025-02-18Refs #31170 -- Added JavaScript tests for RelatedObjectLookups.js.Кайрат Макым
2025-02-18Fixed #36179 -- Unhexed entries and removed duplicates in ↵mimi89999
auth/common-passwords.txt.gz.
2025-02-18Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.Mariusz Felisiak
datetime.UTC was added in Python 3.11.
2025-02-17Fixed #36191 -- Truncated the overwritten file content in FileSystemStorage.Gaël Utard
2025-02-17Fixed #36178 -- Applied consistent object quoting in admin delete ↵antoliny0919
confirmation page.
2025-02-16Refs #35704 -- Used copy.replace() in Operation.reduce() methods.Adam Johnson
2025-02-16Refs #35967 -- Deprecated BaseDatabaseCreation.create_test_db(serialize).Simon Charette
Given there are no longer any internal usages of serialize=True and it poses a risk to non-test databases integrity it seems appropriate to deprecate it.
2025-02-16Fixed #35967 -- Deferred test suite fixtures serialization after all dbs setup.Simon Charette
While the top-level objects fed to serialization are bound to the test database being created nothing prevents code invoked during serialization from performing queries against other connections entries that haven't been swapped yet. The reported example of that is a database router directing all reads to a test mirror for a set of models involving auto-created many-to-many fields. It might be tempting to address the many-to-many field case but this a symptom of a larger problem where the test framework yields the flow execution to user code that could interact with non-test databases in unexpected ways. Deferring test database fixture serialization until the point where all connections entries have been swapped for their test equivalent ensures that no code triggered during serialization can interact with non-test databases. Thanks Jake Howard for the report and Jacob Walls for the initial investigation.
2025-02-15Fixed #36173 -- Stabilized identity of Concat with an explicit output_field.Simon Charette
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.
2025-02-14Fixed #36102 -- Moved i18n comments directly above the translatable string.Julien Palard
xgettext only extracts comment blocks if there is no program code between the comment and the string that gets extracted. For details, see: https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html#Operation-mode Black formatting has been turned off in some places to ensure the comments are not moved, which previously resulted in them being removed from the po files when scripts/manage_translations.py was run.
2025-02-13Corrected SHORT_DATE_FORMAT for Korean (ko).Kim Yeongbin
2025-02-13Fixed #36158 -- Refactored shell command to improve auto-imported objects ↵Natalia
reporting.
2025-02-13Fixed #36182 -- Returned "?" if all parameters are removed in querystring ↵Sarah Boyce
template tag. Thank you to David Feeley for the report and Natalia Bidart for the review.
2025-02-13Fixed #36146 -- Recorded applied/unapplied migrations recursively.Georgi Yanchev
2025-02-13Reverted "Refs #35803 -- Added support for __coveredby GIS lookup on MariaDB ↵Mariusz Felisiak
11.7+." This partly reverts commit 0b7edb9fcdd33d47ec5701b4f9b9553e27a88e95. MariaDB reverted GIS functions.
2025-02-13Reverted "Fixed #35803 -- Added support for Collect, GeoHash, and IsValid on ↵Mariusz Felisiak
MariaDB 11.7+." This reverts commit c77573716a58af32ffcfc4fe87ff9e5c97909bd2. MariaDB reverted GIS functions.
2025-02-13Refs #36181 -- Removed the obsolete SubqueryConstraint machinery.Simon Charette
Adding proper support for subquery right-hand-sides to TupleIn made it obsolete.
2025-02-13Fixed #36181 -- Allowed Subquery usage in __in lookups against composite pks.Simon Charette
Thanks Jacob Walls for the report.
2025-02-11Fixed #36149 -- Allowed subquery values against tuple exact and in lookups.Simon Charette
Non-tuple exact and in lookups have specialized logic for subqueries that can be adapted to properly assign select mask if unspecified and ensure the number of involved members are matching on both side of the operator.
2025-02-10Refs #35515 -- Fixed shell command verbose output when auto-importing 0 or 1 ↵Natalia
object. Co-authored-by: Salvo Polizzi <salvopolizzi03@gmail.com>
2025-02-10Refs #35515 -- Refactored internal `get_and_report_namespace` in the shell ↵Natalia
command.
2025-02-09Fixed #36148 -- Enabled native tuple comparison lookups on SQLite 3.37+ and ↵Simon Charette
Oracle 23.4+. VALUES must be explicitly specified when declaring a sequence of tuples on SQLite < 3.37 but it's not required on >= 3.37. See sqlite/sqlite@9289f51 which addressed the last remaining issue with IN.
2025-02-09Refs #36148 -- Relied on a feature switch to define tuple lookups support.Simon Charette
This should allow backends more easily opt-in or out of native support and rely on the fallback if unavailable.
2025-02-09Refs #373 -- Delegated Tuple compilation to compiler.Simon Charette
This should allow third-party backends to define Tuple.as_vendor() overrides that are taken into consideration which calling as_sql() directly prevents.
2025-02-09Fixed #36105 -- Dropped support for MariaDB 10.5.Mariusz Felisiak
2025-02-06Refs #34975 -- Removed unnecessary lookups.In.get_refs().Simon Charette
Now that In.get_source_expression() includes its right-hand-side when it contains expressions (refs #36025) it no longer requires a specialized get_refs() method.
2025-02-06Fixed #36025 -- Fixed re-aliasing of iterable (in/range) lookups rhs.Simon Charette
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.
2025-02-06Fixed #36061 -- Added migration support for ManyToManyField.through_fields.brian
Added through_fields support to ManyToManyField.deconstruct. Thanks to Simon Charette for pointers and the review.
2025-02-06Fixed #35677 -- Avoided non-sticky filtering of prefetched many-to-many.Simon Charette
The original queryset._next_is_sticky() call never had the intended effect as no further filtering was applied internally after the pk__in lookup making it a noop. In order to be coherent with how related filters are applied when retrieving objects from a related manager the effects of what calling _next_is_sticky() prior to applying annotations and filters to the queryset provided for prefetching are emulated by allowing the reuse of all pre-existing JOINs. Thanks David Glenck and Thiago Bellini Ribeiro for the detailed reports and tests.
2025-02-06Refs #22997 -- Prevented requesting a default value for auto fields.Ben Cail
2025-02-05Fixed #36165 -- Made PostgreSQL's SchemaEditor._delete_index_sql() respect ↵Natalia
the "sql" argument. This is a follow up of bd366ca2aeffa869b7dbc0b0aa01caea75e6dc31. Thank you Daniel Finch for the report.
2025-02-04Fixed #36069 -- Fixed the delete button position in TabularInlines.antoliny0919
2025-02-04Fixed #36055 -- Prevented overlap of object-tools buttons and page header in ↵antoliny0919
the admin.
2025-02-04Fixed #36058 -- Refactored SpatialRefSysMixin.srs to use cached_property.Arnaldo Govenem
Replaced manual caching complexity with cached_property for efficiency. Enhanced error handling with distinct messages for WKT and PROJ.4. Thanks to Sarah Boyce for the suggestions.
2025-02-03Refs #36036 -- Added support for GEOSHasM.Andrew Harris
2025-02-03Fixed #36135 -- Fixed reverse GenericRelation prefetching.Simon Charette
The get_(local|foreign)_related_value methods of GenericRelation must be reversed because it defines (from|to)_fields and associated related_fields in the reversed order as it's effectively a reverse GenericForeignKey itself. The related value methods must also account for the fact that referenced primary key values might be stored as a string on the model defining the GenericForeignKey but as integer on the model defining the GenericRelation. This is achieved by calling the to_python method of the involved content type in get_foreign_related_value just like GenericRelatedObjectManager does. Lastly reverse many-to-one manager's prefetch_related_querysets should use set_cached_value instead of direct attribute assignment as direct assignment might are disallowed on ReverseManyToOneDescriptor descriptors. This is likely something that was missed in f5233dc (refs #32511) when the is_cached guard was added. Thanks 1xinghuan for the report.
2025-02-01Fixed #36140 -- Allowed BaseUserCreationForm to define non required password ↵nessita
fields. Regression in e626716c28b6286f8cf0f8174077f3d2244f3eb3. Thanks buffgecko12 for the report and Sarah Boyce for the review.