Re: [Django] #36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another field

40 views
Skip to first unread message

Django

unread,
Dec 30, 2024, 3:56:47 PM12/30/24
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted

--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 30, 2024, 4:38:13 PM12/30/24
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Mariusz Felisiak (added)

Comment:

Jacob, would you like to prepare a patch?
--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:4>

Django

unread,
Dec 31, 2024, 11:43:26 AM12/31/24
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* owner: (none) => Jacob Walls
* status: new => assigned

Comment:

I'll give it a shot.
--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:5>

Django

unread,
Dec 31, 2024, 1:19:27 PM12/31/24
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* has_patch: 0 => 1

Comment:

[https://github.com/django/django/pull/18979 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:6>

Django

unread,
Jan 5, 2025, 12:13:21 AM1/5/25
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1

Comment:

Will update along the lines of comment:3:ticket:36051.
--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:7>

Django

unread,
Jan 5, 2025, 10:24:04 AM1/5/25
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:8>

Django

unread,
Jan 7, 2025, 3:49:54 AM1/7/25
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:9>

Django

unread,
Jan 7, 2025, 5:42:16 AM1/7/25
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"6eec703667505d87d1354323548943c8d546c5a2" 6eec703]:
{{{#!CommitTicketReference repository=""
revision="6eec703667505d87d1354323548943c8d546c5a2"
Fixed #36042 -- Raised ValueError when using CompositePrimaryKey as rhs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:10>

Django

unread,
Jan 7, 2025, 5:42:16 AM1/7/25
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"470e5545e56e8510f9b9d39a96d7094fedd9c45a" 470e554]:
{{{#!CommitTicketReference repository=""
revision="470e5545e56e8510f9b9d39a96d7094fedd9c45a"
Refs #36042 -- Raised ValueError when providing composite expressions to
aggregates.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:11>

Django

unread,
Jan 22, 2025, 2:56:29 AM1/22/25
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"a76035e925ff4e6d8676c65cb135c74b993b1039" a76035e]:
{{{#!CommitTicketReference repository=""
revision="a76035e925ff4e6d8676c65cb135c74b993b1039"
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.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:12>

Django

unread,
Jan 22, 2025, 2:59:03 AM1/22/25
to django-...@googlegroups.com
#36042: Lookups fail when rhs wraps CompositePrimaryKey in F and lhs is another
field
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"e306687a3a5507d59365ba9bf545010e5fd4b2a8" e306687a]:
{{{#!CommitTicketReference repository=""
revision="e306687a3a5507d59365ba9bf545010e5fd4b2a8"
[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.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36042#comment:13>
Reply all
Reply to author
Forward
0 new messages