| Age | Commit message (Collapse) | Author |
|
Updated references to RemovedInDjango70Warning to use the new warning,
and adjusted references to "Django 7.0" to "Django 2028".
RemovedInDjango70Warning remains importable as an alias of the same
class, so existing warning filters and except clauses in third-party
code keep working across the rename.
|
|
Composite and db_default primary keys are not None when unset, so the
old pk is None check treated distinct unsaved instances as equal.
|
|
The fetch modes feature made all query iteration paths (ModelIterable,
RawModelIterable, and RelatedPopulator) call Model.from_db() with a
fetch_mode keyword argument. This crashed with a TypeError for models
overriding from_db() with the previously documented signature
from_db(cls, db, field_names, values).
Query iteration now detects, once per query rather than per row, whether
the model's from_db() accepts the fetch_mode keyword argument (or
**kwargs) and calls old-style overrides without it, emitting a
RemovedInDjango70Warning asking authors to add the argument.
Regression in e097e8a12f21a4e92594830f1ad1942b31916d0f.
|
|
This aims for consistency in the django.db.models namespace.
Thanks Natalia Bidart and Simon Charette for the idea.
|
|
refresh_from_db().
|
|
primary key.
|
|
This change allows the pattern `MyModel.objects.fetch_mode(...).create(...)` to
set the fetch mode for a new object.
|
|
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>
|
|
even if a value is set.
The logic could likely be adjusted to assign the pre_save value in most cases
to avoid the database transit but it could break in subtle ways so it's not
worth the complexity it would require.
Regression in 94680437a45a71c70ca8bd2e68b72aa1e2eff337.
Co-authored-by: Tim Graham <timograham@gmail.com>
|
|
Removed the can_return_columns_from_insert skip gates on existing
field_defaults tests to confirm the expected number of queries are
performed and that returning field overrides are respected.
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
|
|
per deprecation timeline.
|
|
skips an update query on save.
This adds test coverage for logic change in 9fa4d07ce0729850661a31a6b37c6b48f13d2266.
|
|
is set.
|
|
|
|
Model.save()/asave().
|
|
Model.save()/asave().
The transitional logic added to deprecate the usage of *args for
Model.save()/asave() introduced two issues that this branch fixes:
* Passing extra positional arguments no longer raised TypeError.
* Passing a positional but empty update_fields would save all fields.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
|
|
Affected models where the primary key field is defined with a
default or db_default, such as UUIDField.
|
|
reverse relations.
|
|
https://github.com/psf/black/releases/tag/24.1.0
|
|
Model.refresh_from_db()/arefresh_from_db().
The from_queryset parameter can be used to:
- use a custom Manager
- lock the row until the end of transaction
- select additional related objects
|
|
|
|
Follow up to b0ec87b8578147be4357c90eabcd2b916c780810.
|
|
|
|
Special thanks to Hannes Ljungberg for finding multiple implementation
gaps.
Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for
reviews.
|
|
Black 23.1.0 is released which, as the first release of the year,
introduces the 2023 stable style. This incorporates most of last year's
preview style.
https://github.com/psf/black/releases/tag/23.1.0
|
|
assertQuerySetEqual().
Co-Authored-By: Michael Howitz <mh@gocept.com>
|
|
This change sets the __cause__ attribute to raised exceptions.
|
|
|
|
|
|
Thanks Simon Charette for reviews.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
Most QuerySet methods are mapped onto the Manager and, in general,
it isn't necessary to call .all() on the manager.
|
|
|
|
|
|
This improves readability, accumulates unrecognized arguments raise an
exception with all of them, and avoids refetching the values.
|
|
|
|
positional args for the same field.
|
|
This also replaces assertQuerysetEqual() to
assertSequenceEqual()/assertCountEqual() where appropriate.
Co-authored-by: Peter Inglesby <peter.inglesby@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
QuerySet.alias() allows creating reusable aliases for expressions that
don't need to be selected but are used for filtering, ordering, or as
a part of complex expressions.
Thanks Simon Charette for reviews.
|
|
primary key that has a default.
|
|
|
|
implemented comparisons.
Changed __eq__ to return NotImplemented instead of False if compared to
an object of the same type, as is recommended by the Python data model
reference. Now these models can be compared to ANY (or other objects
with __eq__ overwritten) without returning False automatically.
|
|
key that has a default.
|
|
Co-authored-by: Tim Graham <timograham@gmail.com>
Co-authored-by: Patryk Zawadzki <patrys@room-303.com>
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|