summaryrefslogtreecommitdiff
path: root/django/db/models
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #34570 -- Silenced noop deferral of many-to-many and GFK.Simon Charette2023-05-171-1/+9
| | | | | | | | | While deferring many-to-many and GFK has no effect, the previous implementation of QuerySet.defer() ignore them instead of crashing. Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879. Thanks Paco Martínez for the report.
* Fixed #34539 -- Restored get_prep_value() call when adapting JSONFields.Julie Rymer2023-05-161-0/+2
| | | | Regression in 5c23d9f0c32f166c81ecb6f3f01d5077a6084318.
* Fixed #470 -- Added support for database defaults on fields.Ian Foote2023-05-126-4/+114
| | | | | | | | Special thanks to Hannes Ljungberg for finding multiple implementation gaps. Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for reviews.
* Fixed #34558 -- Fixed QuerySet.bulk_create() crash with Now() on Oracle.Mariusz Felisiak2023-05-111-0/+5
|
* Fixed #34554 -- Fixed Reverse(Value(…)) crash on Oracle.Mariusz Felisiak2023-05-101-1/+2
|
* Removed obsolete docstring from Field.db_returning.Lily Foote2023-05-101-4/+1
| | | | It's also supported on SQLite 3.35+ and MariaDB 10.5+.
* Refs #27236 -- Made more cosmetic edits to Meta.index_together deprecation.Mariusz Felisiak2023-05-051-2/+1
|
* Fixed #34517 -- Avoided connection post_init signal to ImageField without ↵Orhan Hirsch2023-05-031-5/+4
| | | | width/height fields.
* Refs #31369 -- Improved hint message in NullBooleanField's deprecation warning.Paul Brown2023-05-021-1/+1
|
* Fixed #33759 -- Avoided unnecessary subquery in QuerySet.delete() with ↵4the4ryushin2023-05-011-1/+4
| | | | self-referential subqueries if supported.
* Refs #33766 -- Removed sql.Query.build_filtered_relation_q().Simon Charette2023-04-242-32/+15
| | | | It was a copy of sql.Query._add_q that avoided JOIN updates.
* Refs #33766 -- Removed unused Join.equals().Simon Charette2023-04-241-7/+0
| | | | | It's unused now that the specialized FilteredRelation.as_sql logic is no more.
* Fixed #33766 -- Resolved FilteredRelation.condition at referencing time.Simon Charette2023-04-243-48/+58
| | | | | | | | | | | The previous implementation resolved condition at Join compilation time which required introducing a specialized expression resolving mode to alter the join reuse logic solely during that phase. FilteredRelation.condition is now resolved when the relation is first referenced which maintains the existing behavior while allowing the removal of the specialized resolving mode and address an issue where conditions couldn't spawn new joins.
* Refs #16055 -- Deprecated ↵David Wobrock2023-04-183-0/+31
| | | | get_joining_columns()/get_reverse_joining_columns() methods.
* Fixed #16055 -- Fixed crash when filtering against char/text GenericRelation ↵David Wobrock2023-04-183-11/+33
| | | | relation on PostgreSQL.
* Fixed #34480 -- Fixed crash of annotations with Chr().Jacob Walls2023-04-111-0/+1
|
* Fixed #34464 -- Fixed queryset aggregation over group by reference.Simon Charette2023-04-071-0/+3
| | | | | | | | Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7. Refs #28477. Thanks Ian Cubitt for the report.
* Fixed #34458 -- Fixed QuerySet.defer() crash on attribute names.Simon Charette2023-04-051-1/+2
| | | | | | Thanks Andrew Cordery for the report. Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879.
* Fixed #34450 -- Fixed multi-valued JOIN reuse when filtering by expressions.Simon Charette2023-04-041-1/+1
| | | | Thanks Roman Odaisky for the report.
* Fixed #34443 -- Fixed filtering by transforms on reverse relations.Mariusz Felisiak2023-03-281-0/+6
| | | Regression in ce6230aa976e8d963226a3956b45a8919215dbd8.
* Refs #29799 -- Added field instance lookups to suggestions in FieldErrors.Mariusz Felisiak2023-03-281-1/+1
| | | Bug in cd1afd553f9c175ebccfc0f50e72b43b9604bd97.
* Fixed #34437 -- Made values() resolving error mention selected annotations.Simon Charette2023-03-251-5/+10
| | | | | While the add_fields() call from set_values() does trigger validation it does so after annotations are masked resulting in them being excluded from the choices of valid options surfaced through a FieldError.
* Fixed #28553 -- Fixed annotation mismatch with ↵David Wobrock2023-03-241-6/+11
| | | | | | QuerySet.values()/values_list() on compound queries. Co-authored-by: Matthias Kestenholz <mk@feinheit.ch>
* Fixed #34388 -- Allowed using choice enumeration types directly on model and ↵T. Franzel2023-03-211-0/+3
| | | | form fields.
* Fixed some typos in comments, docstrings, and tests.Liyang Zhang2023-03-201-1/+1
|
* Fixed #34421 -- Fixed QuerySet.update() on querysets in descending order by ↵hb6h0572023-03-181-1/+8
| | | | annotations.
* Refs #28329 -- Fixed Cast() with ForeignKey to integer fields on MySQL.David Wobrock2023-03-141-0/+3
|
* Fixed #27397 -- Prevented integer overflows on integer field lookups.Simon Charette2023-03-091-4/+39
| | | | | This prevents a sqlite3 crash and address a potential DDoS vector on PostgreSQL caused by full-table-scans on overflows.
* Fixed #34378 -- Made QuerySet.in_bulk() not clear odering when id_list is ↵Ekaterina Vahrusheva2023-03-031-2/+2
| | | | | | passed. This reverts 340eaded4e30cf25bcd4e9781d33a617fe9c0f84.
* Fixed #34368 -- Made subquery raise NotSupportedError when referencing outer ↵Simon Charette2023-02-272-1/+6
| | | | | | | | window expression. Regression in f387d024fc75569d2a4a338bfda76cc2f328f627. Co-authored-by: Jannis Vajen <jvajen@gmail.com>
* Fixed #34372 -- Fixed queryset crash on order by aggregation using OrderBy.Simon Charette2023-02-271-0/+2
| | | | | | Regression in 278881e37619278789942513916acafaa88d26f3 caused by a lack of expression copying when an OrderBy expression is explicitly provided. Thanks Jannis Vajen for the report and regression test.
* Fixed #34338 -- Allowed customizing code of ValidationError in ↵Xavier Fernandez2023-02-231-11/+51
| | | | BaseConstraint and subclasses.
* Refs #33829 -- Added violation_error_message to constraints' __repr__().Xavier Fernandez2023-02-231-2/+14
|
* Fixed #34355 -- Deprecated passing positional arguments to BaseConstraint.Xavier Fernandez2023-02-221-3/+24
|
* Fixed #34346 -- Ordered selected expressions by position.Simon Charette2023-02-201-8/+35
| | | | | | | | | Used the same approach as for #34176 by using selected expressions position to prevent ambiguous aliases in collisions. Thanks henribru for the report. Regression in 04518e310d4552ff7595a34f5a7f93487d78a406.
* Refs #34176 -- Adjusted group by position variables naming to follow SQL spec.Simon Charette2023-02-181-5/+5
| | | | This avoids conceptual collisions with the notion of indices.
* Fixed #34280 -- Allowed specifying different field values for create ↵tschilling2023-02-141-7/+15
| | | | operation in QuerySet.update_or_create().
* Fixed #34319 -- Fixed Model.validate_constraints() crash on ValidationError ↵Mariusz Felisiak2023-02-081-1/+4
| | | | | | | with no code. Thanks Mateusz Kurowski for the report. Regression in 667105877e6723c6985399803a364848891513cc.
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-015-6/+2
| | | | | | | | 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
* Fixed #34254 -- Fixed return value of Exists() with empty queryset.Raj Desai2023-01-261-0/+1
| | | | Thanks Simon Charette for reviews.
* Fixed #34291 -- Fixed Meta.constraints validation crash on UniqueConstraint ↵Mariusz Felisiak2023-01-261-5/+7
| | | | | | | with ordered expressions. Thanks Dan F for the report. Bug in 667105877e6723c6985399803a364848891513cc.
* Fixed #34227 -- Fixed QuerySet.select_related() with multi-level ↵朱穆穆2023-01-241-1/+8
| | | | FilteredRelation.
* Fixed #34192 -- Preserved callable storage when it returns default_storage.Matt Westcott2023-01-231-2/+3
|
* Fixed #34267 -- Fixed sliced QuerySet.union() crash.Francesco Panico2023-01-201-3/+0
| | | | | | Regression in 3d734c09ff0138441dfe0a59010435871d17950f. Thanks Raphaël Stefanini for the report.
* Refs #34233 -- Used @functools.cache.Nick Pope2023-01-182-2/+2
| | | | Python 3.9+ supports @functools.cache as an alias for @functools.lru_cache(maxsize=None).
* Refs #34233 -- Used str.removeprefix()/removesuffix().Mariusz Felisiak2023-01-183-4/+3
|
* Refs #34233 -- Used types.NoneType.Nick Pope2023-01-183-6/+9
| | | Available since Python 3.10 where it was reintroduced.
* Refs #33543 -- Made Expression.asc()/desc() and OrderBy raise ValueError ↵Mariusz Felisiak2023-01-171-12/+1
| | | | | | when nulls_first/nulls_last=False is passed. Per deprecation timeline.
* Refs #31486 -- Removed ability to pass unsaved model instances to related ↵Mariusz Felisiak2023-01-171-11/+1
| | | | | | filters. Per deprecation timeline.
* Refs #29984 -- Made QuerySet.iterator() without chunk_size raise ValueError ↵Mariusz Felisiak2023-01-171-11/+3
| | | | | | after prefetch_related(). Per deprecation timeline.