Opened 4 weeks ago

Closed 13 days ago

#36614 closed Cleanup/optimization (fixed)

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: Ready for checkin
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 (6)

comment:1 by Adam Johnson, 4 weeks ago

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

comment:2 by Sarah Boyce, 4 weeks ago

Triage Stage: UnreviewedAccepted

comment:3 by Sarah Boyce, 3 weeks ago

Patch needs improvement: set

comment:4 by Adam Johnson, 2 weeks ago

Patch needs improvement: unset

comment:5 by Sarah Boyce, 2 weeks ago

Triage Stage: AcceptedReady for checkin

comment:6 by Sarah Boyce <42296566+sarahboyce@…>, 13 days ago

Resolution: fixed
Status: assignedclosed

In 8b241f8:

Fixed #36614 -- Deprecated QuerySet.values_list(flat=True) without a field.

Thanks to Jacob Walls and Simon Charette for their input.

co-authored-by: Sarah Boyce <42296566+sarahboyce@…>

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