Opened 17 years ago

Closed 17 years ago

#3050 closed enhancement (fixed)

[patch] enable values() even with extra(select=...)

Reported by: Honza Král <Honza.Kral@…> Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal Keywords: values extra
Cc: Honza.Kral@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It is impossible to use values() function if you are using custom fields via extra( select=.. ), this patch changes that
example:

Article.objects.extra( select={'id_plus_one' : 'id + 1'} ).values('id', 'id_plus_one')

The patch doesn't break existing functionality (all tests passed) and adds tests for this feature.

Attachments (2)

values.diff (3.2 KB ) - added by Honza Král <Honza.Kral@…> 17 years ago.
patch implementing the feature
values-5383.diff (3.4 KB ) - added by Honza Král <Honza.Kral@…> 17 years ago.
updated for current trunk (revision 5383)

Download all attachments as: .zip

Change History (7)

by Honza Král <Honza.Kral@…>, 17 years ago

Attachment: values.diff added

patch implementing the feature

comment:1 by Honza Král <Honza.Kral@…>, 17 years ago

I found an older ticket about this issue: #532, it was closed as invalid (for reasons that doesn't apply to this patch)

comment:2 by Honza Král <Honza.Kral@…>, 17 years ago

Summary: enable values() even with extra(select=...)[patch] enable values() even with extra(select=...)

comment:3 by Honza Král <Honza.Kral@…>, 17 years ago

Cc: Honza.Kral@… added

comment:4 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedAccepted

by Honza Král <Honza.Kral@…>, 17 years ago

Attachment: values-5383.diff added

updated for current trunk (revision 5383)

comment:5 by Jacob, 17 years ago

Resolution: fixed
Status: newclosed

(In [5385]) Fixed #3050: you can now use extra(select=...) with values(). Thanks, Honza Kral

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