Code

Opened 8 years ago

Closed 7 years ago

#3050 closed enhancement (fixed)

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

Reported by: Honza Král <Honza.Kral@…> Owned by: adrian
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: UI/UX:

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@…> 8 years ago.
patch implementing the feature
values-5383.diff (3.4 KB) - added by Honza Král <Honza.Kral@…> 7 years ago.
updated for current trunk (revision 5383)

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by Honza Král <Honza.Kral@…>

patch implementing the feature

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

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 Changed 8 years ago by Honza Král <Honza.Kral@…>

  • Summary changed from enable values() even with extra(select=...) to [patch] enable values() even with extra(select=...)

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

  • Cc Honza.Kral@… added

comment:4 Changed 7 years ago by Simon G. <dev@…>

  • Triage Stage changed from Unreviewed to Accepted

Changed 7 years ago by Honza Král <Honza.Kral@…>

updated for current trunk (revision 5383)

comment:5 Changed 7 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.