1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00
Commit Graph

465 Commits

Author SHA1 Message Date
Natalia
608d3ebc88 Fixed #36526 -- Doc'd QuerySet.bulk_update() memory usage when batching.
Thanks Simon Charette for the review.
2025-10-08 18:27:16 -03:00
Jacob Walls
0a09c60e97 Refs #36143, #28596 -- Avoided mentioning exact query parameter limit in bulk_create() docs. 2025-10-03 11:25:17 -04:00
John Parton
1820d35b17 Fixed #36605 -- Added support for QuerySet.in_bulk() after .values() or .values_list().
co-authored-by: Adam Johnson <me@adamj.eu>
co-authored-by: Simon Charette <charette.s@gmail.com>
2025-09-25 08:51:43 -04:00
Jacob Walls
00a84fc6f3 Removed versionadded/changed annotations for 5.2. 2025-09-17 15:17:05 -03:00
blingblin-g
e08fa42fa6 Fixed #36426 -- Added support for further iterables in prefetch_related_objects().
Thanks Sarah Boyce for the review.
2025-09-16 14:14:23 -04:00
David Smith
f81e6e3a53 Refs #36485 -- Rewrapped docs to 79 columns line length.
Lines in the docs files were manually adjusted to conform to the
79 columns limit per line (plus newline), improving readability and
consistency across the content.
2025-08-25 10:51:10 -03:00
Natalia
4286a23df6 Refs #36485 -- Removed double spaces after periods in sentences. 2025-08-25 10:51:10 -03:00
David Smith
6f8e23d1c1 Refs #36485 -- Removed unnecessary parentheses in :meth: and :func: roles in docs. 2025-08-25 10:51:10 -03:00
ontowhee
ddb8529415 Fixed #34262 -- Added support for AnyValue for SQLite, MySQL, Oracle, and Postgresql 16+.
Thanks Simon Charette for the guidance and review. Thanks Tim Schilling for the
documentation review. Thanks David Wobrock for investigation and solution proposals.
2025-05-20 10:01:42 +02:00
Babak Mahmoudy
be1b776ad8 Fixed #36213 -- Doc'd MySQL's handling of self-select updates in QuerySet.update().
Co-authored-by: Andro Ranogajec <ranogaet@gmail.com>
2025-04-02 08:45:03 +02:00
Dmitry Shachnev
77b4ecbd53 Fixed #36260 -- Made bulk_create() work with DB-generated primary keys.
Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-03-26 09:55:09 +01:00
Clifford Gama
ef6a83789b Fixed pronoun disagreement in docs/ref/models/querysets.txt. 2025-03-14 10:47:06 +01:00
Clifford Gama
3235e76eb5 Corrected aggregation example in docs/ref/models/querysets.txt. 2025-03-14 10:47:06 +01:00
Clifford Gama
efe3ca09e0 Fixed incorrect formatting for inline pluralized code references in docs. 2025-03-13 15:18:35 -03:00
samruddhiDharankar
9120a19c4e Fixed #36066 -- Documented that Q objects can be used directly in annotations. 2025-03-10 12:54:23 +01:00
Chris Muthig
4b977a5d72 Fixed #35444 -- Added generic support for Aggregate.order_by.
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-03 11:37:00 +01:00
Sarah Boyce
810edfd742 Removed versionadded/changed annotations for 5.1.
This also removes remaining versionadded/changed annotations for older
versions.
2025-01-15 22:28:37 +01:00
Anthony Joseph
3a8f52fbc6 Fixed #35856 -- Added QuerySet.explain() support for MEMORY/SERIALIZE option on PostgreSQL 17+. 2024-10-30 15:54:48 +01:00
Adam Johnson
26a67943ac Removed outdated note about lack of subquery support in MySQL. 2024-08-28 15:55:30 -03:00
Simon Charette
65ad4ade74 Refs #28900 -- Made SELECT respect the order specified by values(*selected).
Previously the order was always extra_fields + model_fields + annotations with
respective local ordering inferred from the insertion order of *selected.

This commits introduces a new `Query.selected` propery that keeps tracks of the
global select order as specified by on values assignment. This is crucial
feature to allow the combination of queries mixing annotations and table
references.

It also allows the removal of the re-ordering shenanigans perform by
ValuesListIterable in order to re-map the tuples returned from the database
backend to the order specified by values_list() as they'll be in the right
order at query compilation time.

Refs #28553 as the initially reported issue that was only partially fixed
for annotations by d6b6e5d0fd.

Thanks Mariusz Felisiak and Sarah Boyce for review.
2024-07-03 16:36:25 +02:00
Natalia
05cce083ad Removed versionadded/changed annotations for 5.0.
This also removes remaining versionadded/changed annotations for older
versions.
2024-05-22 15:44:07 -03:00
Mariusz Felisiak
160c0ab13a Fixed rendering XOR section in docs. 2024-05-02 09:26:44 +02:00
Mohammad Kazemi
47c608202a Extended docs for Q() objects mentioning the ~ (NOT) operator.
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2024-04-15 13:16:35 -03:00
KimSia Sim
c9ce764f59 Updated conditions to retrieve primary keys in bulk_create() docs. 2023-11-29 11:57:53 +01:00
Aman Pandey
0fcd72bc48 Fixed #34633 -- Made create() method of reverse many-to-one managers clear prefetch_related() cache. 2023-11-28 05:46:04 +01:00
Mariusz Felisiak
718b32c691 Added missing pycon directives in various docs. 2023-10-25 12:27:27 +02:00
Tim Bell
ee104251c4 Fixed #27403 -- Doc'd that QuerySet.prefetch_related() doesn't guarantee transactional consistency.
Added a note about the potential race condition in prefetch_related()
that could produce an inconsistent result, one that does not correspond
to any point in the database history.
2023-10-25 09:49:33 +02:00
lufafajoshua
8adc7c86ab Fixed #34808 -- Doc'd aggregate function's default argument. 2023-10-11 15:17:36 -03:00
Mariusz Felisiak
f9e9526800 Fixed #34873 -- Added QuerySet.explain() support for GENERIC_PLAN option on PostgreSQL 16+. 2023-09-26 12:05:26 +02:00
David Sanders
78b5c90753 Refs #34808 -- Doc'd that aggregation functions on empty groups can return None. 2023-09-21 12:14:15 -03:00
Mariusz Felisiak
3623a0c079 Fixed #34850 -- Dropped support for MariaDB 10.4. 2023-09-19 15:06:05 +02:00
Mariusz Felisiak
295467c04a Removed versionadded/changed annotations for 4.2.
This also removes remaining versionadded/changed annotations for older
versions.
2023-09-18 22:12:40 +02:00
Clément Escolano
cac94dd8aa Fixed #33651 -- Added support for prefetching GenericForeignKey.
Co-authored-by: revanthgss <revanthgss@almabase.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-09-18 13:23:21 +02:00
Mariusz Felisiak
88b5b7b8e5 Corrected QuerySet.prefetch_related() note about GenericRelation().
GenericRelation is a reverse generic relationship so it's always
homogeneous. Mentioning this as a restriction is confusing.
2023-09-16 06:57:38 +02:00
Mariusz Felisiak
2b582387d5 Fixed #34760 -- Dropped support for SQLite < 3.27. 2023-08-04 06:35:13 +02:00
Mariusz Felisiak
b719688b21 Fixed #34761 -- Dropped support for MySQL < 8.0.11. 2023-08-03 18:54:29 +02:00
John Parton
fff14736f1 Fixed #34331 -- Added QuerySet.aiterator() support for prefetch_related(). 2023-07-31 21:17:36 +02:00
John Parton
af0c5caff7 Fixed #34749 -- Corrected QuerySet.acreate() signature in docs. 2023-07-28 18:05:19 +02:00
nessita
addbc90049 Fixed typo in docs/ref/models/querysets.txt.
Removed assignment in example for Blog annotation to match shown result.
2023-07-20 19:45:44 +02:00
Vyacheslav Dmitriev
b126f69416 Refs #30052 -- Clarified that defer() and only() do not work with aggregated fields. 2023-07-20 14:02:17 -03:00
Thomas Chaumeny
89c7454dbd Fixed #34698 -- Made QuerySet.bulk_create() retrieve primary keys when updating conflicts. 2023-07-10 13:17:28 +02:00
Mariusz Felisiak
c4a09499aa Fixed typo in docs/ref/models/querysets.txt. 2023-06-27 12:54:11 +02:00
Nick Pope
f8092ee9ad Improved style of n-tuple wording in docs and comments. 2023-06-23 09:29:35 +02:00
Anders Kaseorg
b81e974e9e Fixed #34604 -- Corrected fallback SQL for n-ary logical XOR.
An n-ary logical XOR Q(…) ^ Q(…) ^ … ^ Q(…) should evaluate to true
when an odd number of its operands evaluate to true, not when exactly
one operand evaluates to true.
2023-06-08 20:41:18 +02:00
Tom Forbes
23d24f82a7 Doc'd that Count("*") is equivalent to COUNT(*) SQL. 2023-04-27 11:52:54 +02:00
Mariusz Felisiak
c487634c10 Added meaningful titles to ..admonition:: directives. 2023-04-21 12:03:59 +02:00
David Sanders
0494efddc4 Fixed #34440 -- Doc'd that & queryset operator works similar to chaining. 2023-04-20 08:37:29 +02:00
django-bot
14459f80ee Fixed #34140 -- Reformatted code blocks in docs with blacken-docs. 2023-03-01 13:03:56 +01:00
tschilling
c5808470aa Fixed #34280 -- Allowed specifying different field values for create operation in QuerySet.update_or_create(). 2023-02-14 11:50:35 +01:00
Carlton Gibson
534ac48297 Refs #34140 -- Applied rst code-block to non-Python examples.
Thanks to J.V. Zammit, Paolo Melchiorre, and Mariusz Felisiak for
reviews.
2023-02-10 19:19:13 +01:00