Django

Code

Ticket #3050 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: Honza Král <Honza.Kral@gmail.com> Assigned to: adrian
Milestone: Component: Database layer (models, ORM)
Version: Keywords: values extra
Cc: Honza.Kral@gmail.com Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

values.diff (3.2 kB) - added by Honza Král <Honza.Kral@gmail.com> on 11/21/06 14:06:00.
patch implementing the feature
values-5383.diff (3.4 kB) - added by Honza Král <Honza.Kral@gmail.com> on 05/30/07 11:09:09.
updated for current trunk (revision 5383)

Change History

11/21/06 14:06:00 changed by Honza Král <Honza.Kral@gmail.com>

  • attachment values.diff added.

patch implementing the feature

11/21/06 14:22:51 changed by Honza Král <Honza.Kral@gmail.com>

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

11/21/06 14:25:30 changed by Honza Král <Honza.Kral@gmail.com>

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

12/27/06 13:04:41 changed by Honza Král <Honza.Kral@gmail.com>

  • cc set to Honza.Kral@gmail.com.

01/30/07 03:01:16 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Accepted.

05/30/07 11:09:09 changed by Honza Král <Honza.Kral@gmail.com>

  • attachment values-5383.diff added.

updated for current trunk (revision 5383)

05/30/07 21:22:41 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #3050 ([patch] enable values() even with extra(select=...))




Change Properties
Action