1
0
mirror of https://github.com/django/django.git synced 2025-03-13 10:50:55 +00:00

33371 Commits

Author SHA1 Message Date
Mariusz Felisiak
7500044a82 Refs #35167 -- Fixed test_bulk_update_custom_get_prep_value() crash on databases that don't support primitives in JSONFields.
For example on Oracle < 21c.
2025-02-20 08:14:18 +01:00
Mariusz Felisiak
65c46d6932
Fixed #35358, Refs #35234 -- Renamed _check() methods to check() for constraints. 2025-02-19 20:27:30 +01:00
Sarah Boyce
86493307f9 Fixed #35908 -- Retired the django-developers and django-users mailing lists.
Co-authored-by: Chaitanya Rahalkar <chaitanyarahalkar@squareup.com>
2025-02-19 12:14:27 +01:00
Mariusz Felisiak
2684a383bc Fixed docs build on Sphinx 8.2+. 2025-02-19 09:44:53 +01:00
Sarah Boyce
d764487e79 Refs #35999 -- Removed #django IRC channel reference from README.rst. 2025-02-19 08:38:24 +01:00
Jacob Walls
0bf412111b Fixed #35167 -- Delegated to super() in JSONField.get_db_prep_save().
Avoids reports of bulk_update() sending Cast expressions
to JSONField.get_prep_value().

Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-02-18 17:28:24 +01:00
Sarah Boyce
9d22a7d8f0 Removed advice to propose a new contrib app. 2025-02-18 16:09:53 +01:00
Simon Charette
c3a23aa02f Fixed #36197 -- Fixed improper many-to-many count() and exists() for non-pk to_field.
Regression in 66e47ac69a7e71cf32eee312d05668d8f1ba24bb.

Thanks mfontana-elem for the report and Sarah for the tests.
2025-02-18 11:43:27 +01:00
Кайрат Макым
51398f8bd5 Fixed #31170 -- Added change event trigger to dismissRelatedLookupPopup. 2025-02-18 10:34:14 +01:00
Кайрат Макым
91bebf1adb Refs #31170 -- Added JavaScript tests for RelatedObjectLookups.js. 2025-02-18 10:34:14 +01:00
mimi89999
727731d76d Fixed #36179 -- Unhexed entries and removed duplicates in auth/common-passwords.txt.gz. 2025-02-18 08:58:49 +01:00
Mariusz Felisiak
efb7f9ced2
Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.
datetime.UTC was added in Python 3.11.
2025-02-18 08:35:36 +01:00
Gaël Utard
0d1dd6bba0 Fixed #36191 -- Truncated the overwritten file content in FileSystemStorage. 2025-02-17 14:01:00 +01:00
antoliny0919
2fa1f99ab4 Fixed #36178 -- Applied consistent object quoting in admin delete confirmation page. 2025-02-17 11:04:10 +01:00
Adam Johnson
c07ba43c4b Refs #35704 -- Used copy.replace() in Operation.reduce() methods. 2025-02-16 19:32:36 +01:00
Simon Charette
2d34ebe49a Refs #35967 -- Deprecated BaseDatabaseCreation.create_test_db(serialize).
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-16 08:43:42 +01:00
Simon Charette
99ac8e2589 Refs #35967 -- Doc'd DatabaseCreation.serialize_db_to_string() method. 2025-02-16 08:37:55 +01:00
Simon Charette
dc69a63f84 Fixed #35967 -- Deferred test suite fixtures serialization after all dbs setup.
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-16 07:58:15 +01:00
Simon Charette
df2c4952df Fixed #36173 -- Stabilized identity of Concat with an explicit 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.
2025-02-15 15:46:59 +01:00
Julien Palard
6fcd0440aa Fixed #36102 -- Moved i18n comments directly above the translatable string.
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-14 15:22:41 +01:00
Luke Cousins
579a1c9996 Corrected wording in docs/ref/models/constraints.txt. 2025-02-14 15:19:12 +01:00
Jaime Terreu
d87bb0eb3e Fixed typo in docs/ref/databases.txt. 2025-02-14 15:15:27 +01:00
Kim Yeongbin
14b46c1b84
Corrected SHORT_DATE_FORMAT for Korean (ko). 2025-02-13 22:35:16 +01:00
Natalia
56e23b2319 Fixed #36158 -- Refactored shell command to improve auto-imported objects reporting. 2025-02-13 16:01:13 +01:00
Sarah Boyce
05002c153c Fixed #36182 -- Returned "?" if all parameters are removed in querystring template tag.
Thank you to David Feeley for the report and Natalia Bidart for the review.
2025-02-13 15:49:25 +01:00
Georgi Yanchev
0ee842bb45 Fixed #36146 -- Recorded applied/unapplied migrations recursively. 2025-02-13 12:52:06 +01:00
Mariusz Felisiak
54a902c6e8 Reverted "Refs #35803 -- Added support for __coveredby GIS lookup on MariaDB 11.7+."
This partly reverts commit 0b7edb9fcdd33d47ec5701b4f9b9553e27a88e95.

MariaDB reverted GIS functions.
2025-02-13 10:38:04 +01:00
Mariusz Felisiak
eb70aafdba Reverted "Fixed #35803 -- Added support for Collect, GeoHash, and IsValid on MariaDB 11.7+."
This reverts commit c77573716a58af32ffcfc4fe87ff9e5c97909bd2.

MariaDB reverted GIS functions.
2025-02-13 10:38:04 +01:00
Simon Charette
d386405e04 Refs #36181 -- Removed the obsolete SubqueryConstraint machinery.
Adding proper support for subquery right-hand-sides to TupleIn made it
obsolete.
2025-02-13 09:29:24 +01:00
Simon Charette
8561100425 Fixed #36181 -- Allowed Subquery usage in __in lookups against composite pks.
Thanks Jacob Walls for the report.
2025-02-13 09:29:24 +01:00
Tim Graham
47c837a1ff
Refs #23919 -- Removed Python 2 workaround in fixtures_regress.
This reverts commit 7e19641b0359c23105cc27eebd9ccb1963546f2a.
2025-02-11 18:38:58 +01:00
Simon Charette
41239fe34d Fixed #36149 -- Allowed subquery values against tuple exact and in lookups.
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-11 09:08:35 +01:00
Natalia
0597e8ad1e Refs #35515 -- Fixed shell command verbose output when auto-importing 0 or 1 object.
Co-authored-by: Salvo Polizzi <salvopolizzi03@gmail.com>
2025-02-10 22:58:26 -03:00
Natalia
44ccd20375 Refs #35515 -- Refactored internal get_and_report_namespace in the shell command. 2025-02-10 22:58:26 -03:00
Natalia
3839afb63a Refs #35515 -- Added missing docs for --no-imports flag for the shell command. 2025-02-10 22:58:26 -03:00
Natalia
ca0794fa32 Wrapped lines at 79 cols in docs/howto/custom-shell.txt. 2025-02-10 22:58:26 -03:00
Mariusz Felisiak
0dc61495b2
Specified "django" repository for twine call in docs/internals/howto-release-django.txt.
It's necessary to specify a repository for `.pypirc` user configurations
with multiple per-project PyPI tokens.

Follow up to 26aedbbc0835df83140c7424df62bda03382f598.
2025-02-10 22:53:31 -03:00
Simon Charette
4a3ad9eebb Fixed #36148 -- Enabled native tuple comparison lookups on SQLite 3.37+ and 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-09 17:45:16 +01:00
Simon Charette
a0a765ddeb Refs #36148 -- Relied on a feature switch to define tuple lookups support.
This should allow backends more easily opt-in or out of native support and rely
on the fallback if unavailable.
2025-02-09 15:15:15 +01:00
Simon Charette
c326cfe3b1 Refs #373 -- Delegated Tuple compilation to compiler.
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-09 15:15:15 +01:00
Mariusz Felisiak
17160819f3
Fixed #36105 -- Dropped support for MariaDB 10.5. 2025-02-09 12:57:40 +01:00
Simon Charette
0bac41fc7e Refs #34975 -- Removed unnecessary lookups.In.get_refs().
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-06 16:57:44 +01:00
Simon Charette
089deb82b9 Fixed #36025 -- Fixed re-aliasing of iterable (in/range) lookups rhs.
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-06 16:57:44 +01:00
brian
b13b8684a0 Fixed #36061 -- Added migration support for ManyToManyField.through_fields.
Added through_fields support to ManyToManyField.deconstruct.
Thanks to Simon Charette for pointers and the review.
2025-02-06 15:26:12 +01:00
Simon Charette
2598b371a9 Fixed #35677 -- Avoided non-sticky filtering of prefetched many-to-many.
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-06 14:27:51 +01:00
Ben Cail
db7b1ae9f6 Refs #22997 -- Prevented requesting a default value for auto fields. 2025-02-06 13:53:43 +01:00
Natalia
1f33f21fca Fixed #36165 -- Made PostgreSQL's SchemaEditor._delete_index_sql() respect the "sql" argument.
This is a follow up of bd366ca2aeffa869b7dbc0b0aa01caea75e6dc31.

Thank you Daniel Finch for the report.
2025-02-05 20:15:39 -03:00
Natalia
e2a8f4dac8 Added stub release notes for 5.1.7. 2025-02-05 11:21:09 -03:00
Natalia
294cc965ef Added release date for 5.1.6, 5.0.12, and 4.2.19. 2025-02-05 10:38:24 -03:00
amirreza sohrabi far
5da3ad7bf9
Clarified docs for default email value in UserManager.create_user(). 2025-02-04 16:35:07 -03:00