[Django] #36473: Usage of new tuple_lookups in 5.2

11 views
Skip to first unread message

Django

unread,
Jun 19, 2025, 10:17:14 AMJun 19
to django-...@googlegroups.com
#36473: Usage of new tuple_lookups in 5.2
-------------------------------------+-------------------------------------
Reporter: Julien Chaumont | Type:
| Uncategorized
Status: new | Component: Database
| layer (models, ORM)
Version: 5.2 | Severity: Normal
Keywords: tuple_lookups | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Hi,

As a part of the composite primary key feature, django 5.2 includes new
utilities such as
[https://github.com/csirmazbendeguz/django/blob/main/django/db/models/fields/tuple_lookups.py#L375
`TupleIn` or `TupleGreaterThan`]. From what I've seen, these helpers can
be used on any columns, and not necessarily on composite primary keys.
However, they're not mentioned anywhere in
[https://docs.djangoproject.com/en/5.2/search/?q=tuplein the
documentation].

Can you clarify if they are considered internals, or if they can be
considered as part of Django's API?
--
Ticket URL: <https://code.djangoproject.com/ticket/36473>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 19, 2025, 11:05:49 AMJun 19
to django-...@googlegroups.com
#36473: Usage of new tuple_lookups in 5.2
-------------------------------------+-------------------------------------
Reporter: Julien Chaumont | Owner: (none)
Type: Uncategorized | Status: new
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: tuple_lookups | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

Short answer is that tuple lookups are not ready for prime time for
anything except usage against composite primary keys as we don't have a
way to represent generic composite fields (think of the equivalent of
`tuple[Field]` as an `output_field`) so they should be considered internal
until at least #27351 is fixed (it should be re-opened).

Happy to answer your question in more details
[https://forum.djangoproject.com/c/internals/orm/9 on the forum] but I'll
close now as we don't use this ticket tracker to answer question (it's for
actionable units of work).
--
Ticket URL: <https://code.djangoproject.com/ticket/36473#comment:1>

Django

unread,
Jun 19, 2025, 11:05:56 AMJun 19
to django-...@googlegroups.com
#36473: Usage of new tuple_lookups in 5.2
-------------------------------------+-------------------------------------
Reporter: Julien Chaumont | Owner: (none)
Type: Uncategorized | Status: closed
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: tuple_lookups | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* resolution: => invalid
* status: new => closed

--
Ticket URL: <https://code.djangoproject.com/ticket/36473#comment:2>

Django

unread,
Jun 19, 2025, 11:07:54 AMJun 19
to django-...@googlegroups.com
#36473: Usage of new tuple_lookups in 5.2
-------------------------------------+-------------------------------------
Reporter: Julien Chaumont | Owner: (none)
Type: Uncategorized | Status: closed
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: tuple_lookups | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Julien Chaumont):

Got it thanks! The actionable outcome would have been to add these helpers
to the documentation, but if it's not intended to be public just yet I
agree with your conclusion.
--
Ticket URL: <https://code.djangoproject.com/ticket/36473#comment:3>
Reply all
Reply to author
Forward
0 new messages