| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2025-10-16 | Refs #28586 - Copied fetch mode in QuerySet.create(). | Adam Johnson | |
| This change allows the pattern `MyModel.objects.fetch_mode(...).create(...)` to set the fetch mode for a new object. | |||
| 2025-10-16 | Fixed #28586 -- Added model field fetch modes. | Adam Johnson | |
| 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> | |||
| 2025-09-17 | Refs #27222 -- Restored Model.save()'s refreshing of db_returning fields ↵ | Simon Charette | |
| 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> | |||
| 2025-09-14 | Fixed #27222 -- Refreshed model field values assigned expressions on save(). | Simon Charette | |
| 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. | |||
| 2025-07-23 | Refs #36500 -- Rewrapped long docstrings and block comments via a script. | django-bot | |
| Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505. | |||
| 2025-02-25 | Removed outdated docstring in tests/basic/models.py. | Clifford Gama | |
| 2025-01-15 | Refs #35060 -- Removed passing positional arguments to Model.save()/asave() ↵ | Sarah Boyce | |
| per deprecation timeline. | |||
| 2025-01-10 | Refs #36064 -- Added test that falsey primary key default/db_default value ↵ | Bendeguz Csirmaz | |
| skips an update query on save. This adds test coverage for logic change in 9fa4d07ce0729850661a31a6b37c6b48f13d2266. | |||
| 2024-09-09 | Refs #373 -- Added Model._is_pk_set() abstraction to check if a Model's PK ↵ | Csirmaz Bendegúz | |
| is set. | |||
| 2024-08-28 | Refs #35060 -- Adjusted deprecation warning stacklevel in Model.save()/asave(). | Simon Charette | |
| 2024-06-26 | Fixed 35561 -- Made *args and **kwargs parsing more strict in ↵ | nessita | |
| Model.save()/asave(). | |||
| 2024-06-25 | Fixed #35554, Refs #35060 -- Corrected deprecated *args parsing in ↵ | Adam Johnson | |
| 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> | |||
| 2024-05-07 | Fixed #35425 -- Avoided INSERT with force_update and explicit pk. | Jacob Walls | |
| Affected models where the primary key field is defined with a default or db_default, such as UUIDField. | |||
| 2024-03-08 | Refs #35044 -- Added Model.refresh_from_db(fields=...) test for clearing ↵ | Giannis Terzopoulos | |
| reverse relations. | |||
| 2024-01-26 | Applied Black's 2024 stable style. | Mariusz Felisiak | |
| https://github.com/psf/black/releases/tag/24.1.0 | |||
| 2024-01-15 | Fixed #28344 -- Allowed customizing queryset in ↵ | Aivars Kalvans | |
| 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 | |||
| 2024-01-02 | Fixed #35060 -- Deprecated passing positional arguments to Model.save()/asave(). | Salvo Polizzi | |
| 2023-11-25 | Refs #34925 -- Avoided altering passed by reference refresh_from_db(fields). | Simon Charette | |
| Follow up to b0ec87b8578147be4357c90eabcd2b916c780810. | |||
| 2023-11-24 | Fixed #34925 -- Prevented Model.refresh_from_db() from mutating list of fields. | trontelj | |
| 2023-05-12 | Fixed #470 -- Added support for database defaults on fields. | Ian Foote | |
| Special thanks to Hannes Ljungberg for finding multiple implementation gaps. Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for reviews. | |||
| 2023-02-01 | Refs #33476 -- Applied Black's 2023 stable style. | David Smith | |
| 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 | |||
| 2022-10-08 | Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵ | Gregor Gärtner | |
| assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com> | |||
| 2022-10-03 | Fixed #23353 -- Used "raise from" when raising TransactionManagementError. | David Wobrock | |
| This change sets the __cause__ attribute to raised exceptions. | |||
| 2022-06-01 | Fixed #33733 -- Preserved wrapper assignment for manager methods. | kshivakumar | |
| 2022-06-01 | Refs #33733 -- Added tests for attributes of manager methods. | Mariusz Felisiak | |
| 2022-04-26 | Fixed #33646 -- Added async-compatible interface to QuerySet. | Andrew Godwin | |
| Thanks Simon Charette for reviews. Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> | |||
| 2022-02-22 | Removed redundant QuerySet.all() calls in docs and tests. | Nick Pope | |
| Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager. | |||
| 2022-02-07 | Refs #33476 -- Refactored code to strictly match 88 characters line length. | Mariusz Felisiak | |
| 2022-02-07 | Refs #33476 -- Reformatted code with Black. | django-bot | |
| 2022-01-13 | Improved Model.__init__() properties loop. | Adam Johnson | |
| This improves readability, accumulates unrecognized arguments raise an exception with all of them, and avoids refetching the values. | |||
| 2021-03-06 | Fixed #24141 -- Added QuerySet.contains(). | Johan Schiff | |
| 2021-03-01 | Fixed #22640 -- Raised TypeError when instantiating model with keyword and ↵ | Jacob Walls | |
| positional args for the same field. | |||
| 2020-11-06 | Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly. | Hasan Ramezani | |
| 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> | |||
| 2020-07-31 | Fixed #27719 -- Added QuerySet.alias() to allow creating reusable aliases. | Alexandr Tatarinov | |
| 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. | |||
| 2020-03-05 | Fixed #29129 -- Skipped UPDATE when adding a model instance with inherited ↵ | Abhijeet Viswa | |
| primary key that has a default. | |||
| 2020-02-04 | Simplified imports from django.db and django.contrib.gis.db. | Nick Pope | |
| 2019-10-01 | Fixed #30651 -- Made __eq__() methods return NotImplemented for not ↵ | ElizabethU | |
| 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. | |||
| 2019-08-19 | Fixed #29260 -- Skipped an UPDATE when adding a model instance with primary ↵ | Hasan Ramezani | |
| key that has a default. | |||
| 2019-05-12 | Fixed #6785 -- Made QuerySet.get() fetch a limited number of rows. | Amir Hadi | |
| 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> | |||
| 2019-04-24 | Refs #30254 -- Added tests for Model.__hash__() inheritance. | Carlton Gibson | |
| 2018-11-27 | Switched setUp() to setUpTestData() where possible in Django's tests. | Simon Charette | |
| 2018-11-15 | Added a test for a lookup in Model.refresh_from_db(fields=[...]). | Hasan Ramezani | |
| 2018-11-06 | Used QuerySet.bulk_create() in a couple tests. | oliver | |
| 2018-09-18 | Fixed #23646 -- Added QuerySet.bulk_update() to efficiently update many models. | Tom Forbes | |
| 2018-08-20 | Fixed #29625 -- Made Model.refresh_from_db() clear prefetch related caches. | Ming Qin | |
| 2018-06-25 | Fixed #29517 -- Rephrased error message when passing incorrect kwarg to ↵ | Federico Bond | |
| model constructor | |||
| 2018-04-19 | Fixed #28574 -- Added QuerySet.explain(). | Tom | |
| 2018-01-30 | Fixed #29076 -- Made Model.refresh_from_db() clear cached relationships even ↵ | Jon Dufresne | |
| if the related id doesn't change. | |||
| 2017-10-12 | Fixed #27846 -- Made Model.refresh_from_db() clear cached relations. | Paulo | |
| 2017-09-25 | Removed DatabaseFeatures.supports_microsecond_precision. | Tim Graham | |
| MySQL 5.5 (refs #28552) was the last database to use it. | |||
