1
0
mirror of https://github.com/django/django.git synced 2025-03-06 23:42:33 +00:00

24 Commits

Author SHA1 Message Date
Simon Charette
d4d2e09f19 [5.2.x] Fixed #36122 -- Raised FieldError when updating with composite reference value.
Thanks Jacob Walls for the report and test.

Backport of efec74b90868c2e611f863bf4301d92ce08067e8 from main.
2025-01-28 13:19:36 +01:00
Jacob Walls
791ed4fd97 [5.2.x] Fixed #36120 -- Raised FieldError when targeting a composite primary key field with QuerySet.update().
Backport of 72ff18d41cfb004ae180bdf87fd8bad93041c691 from main.
2025-01-28 11:20:51 +01:00
Simon Charette
1df0f998ae [5.2.x] Fixed #36117 -- Raised ValueError when providing composite expressions to case / when.
Remove redundant Case and When.resolve_expression to delegate composite
expression support to BaseExpression.

Thanks Jacob Tyler Walls for the report and test.

Backport of 00c690efbc0b10f67924687f24a7b30397bf47d9 from main.
2025-01-22 08:58:23 +01:00
Simon Charette
e306687a3a [5.2.x] Refs #36042 -- Consolidated composite expression checks in BaseExpression.
Remove redundant Func.resolve_expression and adjust CombinedExpression to
delegate source expression resolving to super() to perform checks against
allows_composite_expressions in a single location.

Backport of a76035e925ff4e6d8676c65cb135c74b993b1039 from main.
2025-01-22 08:57:40 +01:00
Jacob Walls
1602666b79 Fixed #36100 -- Checked if composite pk is set in get_next/get_previous. 2025-01-15 17:23:46 +01:00
Simon Charette
f07360e808 Refs #36075 -- Adjusted MTI handling of _non_pk_concrete_field_names.
Regression in bf7b17d16d3978b2e1cee4a0f7ce8840bd1a8dc4.

Thanks Sage Abdullah for the report.
2025-01-14 16:21:19 +01:00
Bendeguz Csirmaz
d83fb782d3 Fixed #36092 -- Disallowed non-local fields in composite primary keys. 2025-01-13 14:21:41 +01:00
Sarah Boyce
bf7b17d16d Refs #36075 -- Used field in pk_fields over field.primary_key. 2025-01-13 12:04:59 +01:00
Bendeguz Csirmaz
8bee7fa45c Fixed #36050 -- Added OuterRef support to CompositePrimaryKey. 2025-01-10 14:38:09 +01:00
Bendeguz Csirmaz
5851605863 Fixed #36064 -- Skipped an UPDATE when adding a model instance with a composite primary key with default values. 2025-01-10 11:43:38 +01:00
Jacob Walls
0fb51ec5a0 Fixed #36068 -- Raised ValueError when providing a composite PK field to bulk_create() update_fields. 2025-01-10 08:23:39 +01:00
Simon Charette
af6336f2c8 Fixed #36074 -- Excluded composite primary key fields on save() updates. 2025-01-09 17:38:42 +01:00
Sarah Boyce
6a1a9c0ead Fixed #36062 -- Handled serialization of CompositePrimaryKeys. 2025-01-08 14:52:59 +01:00
Simon Charette
42e8f264ce Fixed #36065 -- Fixed ordering by expression referencing composite primary key.
Thanks Jacob Walls for the report and test and Csirmaz Bendegúz for the review.
2025-01-08 10:20:48 +01:00
Simon Charette
7617d5be94 Refs #36065 -- Extracted composite primary key order by tests. 2025-01-08 10:20:48 +01:00
Jacob Walls
470e5545e5 Refs #36042 -- Raised ValueError when providing composite expressions to aggregates. 2025-01-07 11:42:06 +01:00
Jacob Walls
6eec703667 Fixed #36042 -- Raised ValueError when using CompositePrimaryKey as rhs. 2025-01-07 11:42:06 +01:00
Jacob Walls
46b3e7dd8c Fixed #36048 -- Preferred ValueError to NotSupportedError for composite pk sanity checks.
These checks are not backend-dependent.
2025-01-06 09:33:27 +01:00
Jacob Walls
2a61b5f97c Refs #373 -- Errored when providing db_column to CompositePrimaryKey. 2025-01-02 13:03:49 +01:00
Tim Graham
733d3998e2
Refs #373 -- Fixed false failure of test_error_on_comment_pk_conflict.
The test failed with "NOT NULL constraint failed" rather than
"UNIQUE constraint failed: tenant_id, comment_id".
2024-12-26 23:29:04 -03:00
Sarah Boyce
28f81a1019 Refs #373 -- Fixed CompositePrimaryKey tests if yaml isn't installed. 2024-12-05 10:23:34 +01:00
Mariusz Felisiak
49761ac99a Refs #373 -- Simplified DatabaseIntrospection.get_constraints() tests for composite primary keys. 2024-12-02 11:03:42 +01:00
Mariusz Felisiak
81cf690111 Refs #373 -- Fixed CompositePKChecksTests.test_composite_pk_cannot_include_generated_field() test crash on databases with no GeneratedField support. 2024-12-02 08:37:53 +01:00
Bendeguz Csirmaz
978aae4334 Fixed #373 -- Added CompositePrimaryKey.
Thanks Lily Foote and Simon Charette for reviews and mentoring
this Google Summer of Code 2024 project.

Co-authored-by: Simon Charette <charette.s@gmail.com>
Co-authored-by: Lily Foote <code@lilyf.org>
2024-11-29 11:23:04 +01:00