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 , 10 hours ago
Has patch: | set |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:2 by , 10 hours ago
Triage Stage: | Unreviewed → Accepted |
---|
Note:
See TracTickets
for help on using tickets.