1
0
mirror of https://github.com/django/django.git synced 2025-08-21 09:19:12 +00:00

33754 Commits

Author SHA1 Message Date
Antoliny Lee
3bd583f55b
Refs #36528 -- Fixed link underline typo in CSS.
Regression in 792ca148a2d6da6cf0778f6a866c899208ab94f9.
2025-08-17 20:43:20 +02:00
Nick Pope
8b229b4dbb Refs #31123 -- Simplified create_contentypes().
Since 142ab6846ac09d6d401e26fc8b6b988a583ac0f5
get_contenttypes_and_models() function was only used in this module and
we only needed the model names, not the content type objects themselves.
2025-08-16 20:48:53 +02:00
Simon Charette
cd0966cd4e Avoided usage of DEBUG setting override in bulk_create tests.
Asserting an upper bound for the number of executed queries can be achieved by
using CaptureQueriesContext instead of enabling the whole DEBUG machinery.
2025-08-15 10:45:02 +02:00
Simon Charette
5eca562ac3 Refs #36490 -- Simplified QuerySet._batched_insert returning fields handling.
Whether or not returning_fields should be specified to _insert is not a
function of each batches so the conditional can be moved outside of the loop.
2025-08-15 10:45:02 +02:00
Simon Charette
e1671278e8 Fixed #36490 -- Avoided unnecessary transaction in bulk_create.
When dealing with an heterogeneous set of object with regards to primary key
assignment that fits in a single batch there's no need to wrap the single
INSERT statement in a transaction.
2025-08-15 10:45:02 +02:00
farhan
5e06b97095 Fixed #36410 -- Added support for Template Partials to the Django Template Language.
Introduced `{% partialdef %}` and `{% partial %}` template tags to
define and render reusable named fragments within a template file.
Partials can also be accessed using the `template_name#partial_name`
syntax via `get_template()`, `render()`, `{% include %}`, and other
template-loading tools.

Adjusted `get_template()` behavior to support partial resolution, with
appropriate error handling for invalid names and edge cases. Introduced
`PartialTemplate` to encapsulate partial rendering behavior.

Includes tests and internal refactors to support partial context
binding, exception reporting, and tag validation.

Co-authored-by: Carlton Gibson <carlton@noumenal.es>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2025-08-14 21:53:14 -03:00
David Sanders
fda3c1712a Aligned format of constraint examples in docs/ref/models/constraints.txt. 2025-08-13 09:09:19 +02:00
antoliny0919
a9b07cec03 Fixed #35924 -- Removed the "choose/remove all" button icons in the FilteredSelectMultiple widget. 2025-08-13 09:08:34 +02:00
Natalia
2980627502 Fixed #36499 -- Adjusted utils_tests.test_html.TestUtilsHtml.test_strip_tags following Python's HTMLParser new behavior.
Python fixed a quadratic complexity processing for HTMLParser in:
https://github.com/python/cpython/commit/6eb6c5db.
2025-08-12 23:04:09 -03:00
Natalia
e4515dad7a Fixed test_utils.tests.HTMLEqualTests.test_parsing_errors following Python's HTMLParser fixed parsing.
Further details about Python changes can be found in:
0243f97cba.

Thank you Clifford Gama for the thorough review!
2025-08-12 23:04:09 -03:00
michalpokusa
2c99fbcf95 Fixed #36368 -- Prevented duplicate locale paths and write_po_file calls in makemessages. 2025-08-12 09:47:16 +02:00
Tim Graham
80cc9994d1 Remove unused OneToOneField from DatabaseWrapper.data_types.
OneToOneField uses the type of the related field.
2025-08-12 09:46:20 +02:00
Jacob Walls
eed7f44244 Refs #36210 -- Added release note for further subquery support for composite pks.
Follow-up to fd569dd45bf0746378faf7f65172497f21ed27f0.
2025-08-11 10:22:59 +02:00
Jacob Walls
181e3bd71c Refs #36210 -- Corrected output_field comparison in Subquery.resolve_expression().
Regression in fd569dd45bf0746378faf7f65172497f21ed27f0.
2025-08-11 10:22:04 +02:00
Rohit
fa804d0d14 Corrected code examples in topics docs. 2025-08-11 10:12:43 +02:00
David Smith
7a80e29fea Improved docs.yml GitHub Action covering docs quality checks.
This change renames the `docs` job to `spelling` to better reflect its
purpose. It also removes the unused `--keep-going` flag, since starting
with Sphinx 8.1, `--keep-going` is enabled by default.

See:
https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-keep-going
2025-08-08 16:39:50 -03:00
James Bligh
c1aa4a7a79 Fixed #36525 -- Silenced individual deleted file messages in collectstatic --clear's default verbosity. 2025-08-08 09:52:16 +02:00
Xinyi Rong
31a43c571f Fixed #36540 -- Updated request.auser() in contrib.auth.alogin() and contrib.auth.alogout(). 2025-08-08 09:51:03 +02:00
Alec Kerrigan
117f90dea5 Fixed typo in django/contrib/gis/geos/geometry.py. 2025-08-08 09:50:28 +02:00
Jacob Walls
fd569dd45b Fixed #36210, Refs #36181 -- Allowed Subquery usage in further lookups against composite pks.
Follow-up to 8561100425876bde3be4b2a22324655f74ff9609.

Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-08-07 14:28:44 +02:00
Jacob Walls
de7bb7eab8 Refs #36210 -- Added missing limits in Subquery tests. 2025-08-07 14:28:44 +02:00
Sarah Boyce
0bff53b413 Added stub release notes for 5.2.6. 2025-08-06 10:32:17 +02:00
Sarah Boyce
8999b0e2bf Added release date for 5.2.5. 2025-08-06 09:58:49 +02:00
David Smith
7f9bf357fe Refs #36485 -- Grouped docs checks under a unified make check target.
Added a new 'check' rule to the docs Makefile which runs both the black
and spelling checks.
2025-08-05 12:18:19 -03:00
David Smith
cba7328196 Refs #34140 -- Added dedicated code block formatting section in docs/internals/contributing/writing-documentation.txt. 2025-08-05 12:18:19 -03:00
James Bligh
6142e3f347 Fixed #26583 -- Silenced individual clashing name warnings in collectstatic's default verbosity.
Made collectstatic report individual destination conflicts only at verbosity 2+.
Made verbosity level 1 report a summary count of skipped files.
2025-08-05 16:37:43 +02:00
antoliny0919
6537732585 Fixed #36079 -- Fixed text size of TabularInline object titles. 2025-08-05 16:36:06 +02:00
Matthias Kestenholz
0a262c8407 Fixed #36537 -- Ensured unique HTML IDs for geometry widget option scripts in the admin.
This work amends the code from f2f6046c0f92ff1faed057da0711ac478eef439c
where multiple geometry widgets rendered `<script>` elements in the
admin with the same HTML `id`, resulting in invalid HTML and fragile
JavaScript selectors. Refs #25706.

This change uses the widget's textarea ID to generate a unique `id` for
each JSON options `<script>`, ensuring valid and robust markup.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-08-05 11:35:04 -03:00
jkhall81
2013092b69 Fixed #36530 -- Extended fields.E347 to check for ManyToManyField involving CompositePrimaryKey on either side.
Thanks to Jacob Walls for the report.
2025-08-05 08:34:40 -03:00
Mariusz Felisiak
e664c5afa9
Refs #36282 -- Fixed PrefetchRelatedMTICacheTests test ordering expectations. 2025-08-05 10:13:00 +02:00
Natalia
9cec8d9f55 Fixed #36535 -- Ensured compatibility with docutils 0.19 through 0.22.
Regression in 65ab92f6a83644bbb555d0eff3a02d8d9301aba4.
2025-08-04 21:52:25 -03:00
Adam Zapletal
dca8284a37 Corrected assertNumQueries() example in docs/topics/testing/tools.txt. 2025-08-04 15:07:48 +02:00
Jacob Walls
8914f4703c Fixed #35972 -- Fixed lookup crashes after subquery annotations. 2025-08-04 10:14:01 +02:00
Simon Charette
079d31e698 Fixed #34871, #36518 -- Implemented unresolved lookups expression replacement.
This allows the proper resolving of lookups when performing constraint
validation involving Q and Case objects.

Thanks Andrew Roberts for the report and Sarah for the tests and review.
2025-08-04 09:22:53 +02:00
Mariusz Felisiak
500bd42b96
Refs #35844 -- Readded optional requirements on daily builds for Python 3.14. 2025-08-01 09:43:22 +02:00
Roel Delos Reyes
748ca0a146 Fixed #36439 -- Optimized acheck_password by using sync_to_async on verify_password. 2025-07-31 11:12:50 +02:00
antoliny0919
6ea3319079 Fixed #36511 -- Ensured filters came before table in keyboard navigation in admin changelist. 2025-07-30 17:32:39 +02:00
antoliny0919
792ca148a2 Fixed #36528, Refs #34917 -- Removed role="button" from object-tools links.
Regression in 849f8307a5bb33465252d0891a9b2c47dde65889.
In order to prevent underlines on links styled like buttons, role="button" was added.
This has been removed and the style updated to reflect that these are links.
2025-07-30 15:36:56 +02:00
antoliny0919
94c2f3b993 Fixed #36055 -- Prevented overlap of object-tools buttons and page header in the admin. 2025-07-30 11:09:45 +02:00
nessita
f96c8f07e4
Refs #36500 -- Ignored formatting changes in git blame. 2025-07-29 21:51:33 -03:00
Mariusz Felisiak
65ab92f6a8
Fixed writer_name deprecation warning in docutils 0.22+. 2025-07-29 21:50:16 -03:00
Mariusz Felisiak
d55979334d Fixed #36531 -- Added forkserver support to parallel test runner. 2025-07-29 14:11:22 -03:00
mriduldhall
d4dd3e503c Fixed #36519 -- Made center template filter consistent for even/odd padding.
Refactored `center` template filter to match f-string behaviour,
producing consistent padding for both odd and even fillings.

Thanks Lily Acorn for the report and Natalia Bidart for the review.

Co-authored-by: Lily Acorn <code@lilyf.org>
2025-07-28 16:41:06 -03:00
mriduldhall
2d4ca62170 Added test for various widths in tests/template_tests/filter_tests/test_center.py. 2025-07-28 16:41:06 -03:00
Simon Charette
0a4999b422 Fixed #36522 -- Added support for filtering composite pks using a tuple of expressions.
Thanks Jacob Walls for the report, and Sarah Boyce and Mariusz Felisiak
for reviews.
2025-07-28 16:39:28 -03:00
Jordan Bae
fdeca38072 Moved manual testing instructions from intro to submitting patches docs.
The section on manual testing, including how to use a local checkout of
Django, is moved from the contribution intro to the submitting patches
docs. This makes it easier for reviewers and authors to follow best
practices.
2025-07-28 08:55:42 -03:00
Clifford Gama
45ba7683a6 Refs #36438 -- Made FieldOperation.references_field() detect references in GeneratedField.expression.
Thanks to Simon Charette for the suggestion and review.
2025-07-25 13:59:13 +02:00
Clifford Gama
1a7fc0f65d Fixed #36438 -- Made MigrationAutodetector remove generated fields before their base fields.
Thanks to Colton Saska for the report and to Simon Charette for the review.
2025-07-25 13:59:13 +02:00
Mike Edmunds
9ab1991689 Fixed #35581 -- Updated django.core.mail to Python's modern email API.
- Changed EmailMessage.message() to construct a "modern email API"
  email.message.EmailMessage and added policy keyword arg.
- Added support for modern MIMEPart objects in EmailMessage.attach()
  (and EmailMessage constructor, EmailMessage.attachments list).
- Updated SMTP EmailBackend to use modern email.policy.SMTP.

Deprecated:
- Attaching MIMEBase objects (replace with MIMEPart)
- BadHeaderError (modern email uses ValueError)
- SafeMIMEText, SafeMIMEMultipart (unnecessary for modern email)
- django.core.mail.forbid_multi_line_headers()
  (undocumented, but exposed via `__all__` and in wide use)
- django.core.mail.message.sanitize_address()
  (undocumented, but in wide use)

Removed without deprecation (all undocumented):
- EmailMessage.mixed_subtype
- EmailMultiAlternatives.alternative_subtype
- Support for setting (undocumented) EmailMessage.encoding property
  to a legacy email.charset.Charset object

Related changes:
- Dropped tests for incorrect RFC 2047 encoding of non-ASCII email
  address localparts. This is specifically prohibited by RFC 2047, and
  not supported by any known MTA or email client. (Python still
  mis-applies encoded-word to non-ASCII localparts, but it is a bug that
  may be fixed in the future.)
- Added tests that try to discourage using Python's legacy email APIs
  in future updates to django.core.mail.
2025-07-25 13:50:02 +02:00
Mike Edmunds
20c62199ff Refs #35581 -- Added missing test for lazy email headers.
EmailMessage is intended to support lazy strings in any header field
(via coercion to `str` in forbid_multi_line_headers() called from
SafeMIMEMessage/Text/Multipart.__setitem__).
2025-07-25 13:50:02 +02:00