Re: Interaction of annotate() and values()

2009-02-11 Thread Russell Keith-Magee
On Wed, Feb 11, 2009 at 4:43 PM, Malcolm Tredinnick wrote: > >> By way of example, this is what 1.0.X produces: >> >> >>> Book.objects.extra(select={'a':'name','b':'price','c':'pages'}).values('name','pages','a') >> [{'a': u'Book 1', 'c': 11, 'b': Decimal("11.11"), 'name': u'Book 1', >> 'pages':

Re: Interaction of annotate() and values()

2009-02-10 Thread Malcolm Tredinnick
On Tue, 2009-02-10 at 19:43 +0900, Russell Keith-Magee wrote: > On Tue, Feb 10, 2009 at 1:53 PM, Malcolm Tredinnick > wrote: > > > > On Sun, 2009-02-08 at 15:56 +0900, Russell Keith-Magee wrote: > > [...] > >> There is a slight complication, though. The ordering of values() and > >> annotate() is

Re: Interaction of annotate() and values()

2009-02-10 Thread Russell Keith-Magee
On Tue, Feb 10, 2009 at 1:53 PM, Malcolm Tredinnick wrote: > > On Sun, 2009-02-08 at 15:56 +0900, Russell Keith-Magee wrote: > [...] >> There is a slight complication, though. The ordering of values() and >> annotate() is significant - values() controls the grouping of >> annotated values if it p

Re: Interaction of annotate() and values()

2009-02-09 Thread Malcolm Tredinnick
On Sun, 2009-02-08 at 15:56 +0900, Russell Keith-Magee wrote: [...] > There is a slight complication, though. The ordering of values() and > annotate() is significant - values() controls the grouping of > annotated values if it precedes the annotate(). This is the nub of the problem, isn't it. We

Re: Interaction of annotate() and values()

2009-02-08 Thread Russell Keith-Magee
On Mon, Feb 9, 2009 at 3:12 PM, Karen Tracey wrote: > On Sun, Feb 8, 2009 at 1:56 AM, Russell Keith-Magee > wrote: >> >> So - some options: >> >> 1) Leave things as-is. Annotated columns always appear in the result >> set. This is inconsistent with extra(), and means you can't use >> annotated q

Re: Interaction of annotate() and values()

2009-02-08 Thread Karen Tracey
On Sun, Feb 8, 2009 at 1:56 AM, Russell Keith-Magee wrote: > So - some options: > > 1) Leave things as-is. Annotated columns always appear in the result > set. This is inconsistent with extra(), and means you can't use > annotated queries in __in clauses. > > 2) Modify things slightly - annotate()

Interaction of annotate() and values()

2009-02-07 Thread Russell Keith-Magee
Hi all, I've been working my way through a couple of aggregation tickets, and I've hit a bit of an inconsistency that I think may need to be addressed. The problem lies in the interaction of values() and annotate(), especially as compared to the interaction of extra() and values(). Ordinarily, v