Opened 11 hours ago

Last modified 10 hours ago

#36614 assigned Cleanup/optimization

Deprecate QuerySet.values_list(flat=True) with no fields

Reported by: Adam Johnson Owned by: Adam Johnson
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In #36606, this case was optimized, but it was also agreed we can deprecate it. Using values_list(flat=True) doesn’t clearly declare which fields to fetch, and while it happens to select the PK due to field ordering, that’s unclear. It's also a bit counterintuitive, compared to calls without flat=True, which select *all* fields.

Change History (2)

comment:1 by Adam Johnson, 10 hours ago

Has patch: set
Owner: set to Adam Johnson
Status: newassigned

comment:2 by Sarah Boyce, 10 hours ago

Triage Stage: UnreviewedAccepted
Note: See TracTickets for help on using tickets.
Back to Top