| Age | Commit message (Collapse) | Author |
|
This is a more attractive target for alteration than all of QuerySet.__init__().
|
|
|
|
manager.get_queryset() always returns freshly instantiated per-instance
QuerySet which doesn't need subsequent cloning.
Based on work originally done by Anssi Kääriäinen and Tim Graham.
|
|
Multiple calls are idempotent assuming they're balanced. Also, multiple
calls to disable cloning followed by a single call to re-enable cloning
will subsequently cause clones to occur - it is not a stack, just a
toggle.
@contextlib.contextmanager is intentionally not used for performance
reasons:
- decorator takes 1.1µs to execute, or 2µs if used correctly in a
`with ...:` statement
- custom class takes 300ns to execute, or 900ns if used correctly in a
`with ...:` statement
Based on work originally done by Anssi Kääriäinen and Tim Graham.
|
|
Thanks Simon Charette for the idea.
|
|
|
|
|
|
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
|
|
dictionary expansion.
|
|
distinct(*fields).
|
|
This change allows the pattern `MyModel.objects.fetch_mode(...).create(...)` to
set the fetch mode for a new object.
|
|
This change ensures that behavior and performance remain consistent when
traversing relationships.
|
|
May your database queries be much reduced with minimal effort.
co-authored-by: Andreas Pelme <andreas@pelme.se>
co-authored-by: Simon Charette <charette.s@gmail.com>
co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
|
|
when aggregating.
|
|
Thanks to Jacob Walls and Simon Charette for their input.
co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
|
|
Now that the setup is a bit more expensive, it makes sense to return earlier
for the empty case.
|
|
.values_list().
co-authored-by: Adam Johnson <me@adamj.eu>
co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
ManyToManyField was already excluded from fields, concrete_fields,
and local_concrete_fields in Options.
|
|
|
|
prefetch_related_objects().
Thanks Sarah Boyce for the review.
|
|
This required implementing UPDATE RETURNING machinery that heavily
borrows from the INSERT one.
|
|
values().
|
|
QuerySet.in_bulk().
|
|
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.
|
|
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.
|
|
Manually reformatted some comments and docstrings where autofix_w505.py
changed the meaning of the formatting.
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
|
|
|
|
order_with_respect_to.
|
|
Regression in 9cb8baa0c4fa2c10789c5c8b65f4465932d4d172.
Thank you to Antoine Humeau for the report and Simon Charette for the review.
|
|
composite pk.
Thanks Jacob Walls for the report and Sarah for the in-depth review.
|
|
through values().
The issue was only manifesting itself when also filtering againt a related
model as that forces the usage of a subquery because SQLUpdateCompiler doesn't
support the UPDATE FROM syntax yet.
Regression in 65ad4ade74dc9208b9d686a451cd6045df0c9c3a.
Refs #28900.
Thanks Gav O'Connor for the detailed report.
|
|
on Oracle.
Virtual CompositePrimaryKey fields should be ignored.
Regression in 1831f7733d3ef03d1ca7fac3e8d9f4c5e3e3375e.
|
|
Signed-off-by: SaJH <wogur981208@gmail.com>
|
|
Now that selected aliases are stored in sql.Query.selected: dict[str, Any]
the values_list() method must ensures that duplicate field name references are
assigned unique aliases.
Refs #28900.
Regression in 65ad4ade74dc9208b9d686a451cd6045df0c9c3a.
Thanks Claude for the report.
|
|
|
|
To avoid looping over objs twice.
|
|
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
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.
|
|
When all values of a field with a db_default are DatabaseDefault, which
is the case most of the time, there is no point in specifying explicit
DEFAULT for all INSERT VALUES as that's what the database will do anyway
if not specified.
In the case of PostgreSQL doing so can even be harmful as it prevents
the usage of the UNNEST strategy and in the case of Oracle, which
doesn't support the usage of the DEFAULT keyword, it unnecessarily
requires providing literal db defaults.
Thanks Lily Foote for the review.
|
|
alias.
Regression in ed0cbc8d8b314e3b4a0305d0be3cf366d8ee4a74.
|
|
max_batch_size.
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
get_prefetch_queryset() per deprecation timeline.
|
|
Regression in bf7b17d16d3978b2e1cee4a0f7ce8840bd1a8dc4.
Thanks Sage Abdullah for the report.
|
|
|
|
bulk_create() update_fields.
|
|
|
|
|