gavinzheng / django-reporting

Automatically exported from code.google.com/p/django-reporting
0 stars 0 forks source link

Annotation is keyed incorrectly #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the annotation values are keyed on the field names, which is 
incorrect. This prevents me from, say, having a report that gives the 
stddev and the avg of the same field (which I need).

With the attached patch, I can enter the following:
    annotate = (
        ('id', Count, 'Total'),
        ('score', Avg, 'Mean'),
        ('score', StdDev, 'StdDev'),
    )
And it doesn't explode!

-Mike

Original issue reported on code.google.com by mcax...@gmail.com on 7 Jan 2010 at 7:50

Attachments:

GoogleCodeExporter commented 9 years ago
Ooops, forgot to fix it for aggregates as well. Fix attached.

Original comment by mcax...@gmail.com on 7 Jan 2010 at 7:54

Attachments:

GoogleCodeExporter commented 9 years ago
This patch is correct, I promise :)

Original comment by mcax...@gmail.com on 7 Jan 2010 at 7:55

Attachments:

GoogleCodeExporter commented 9 years ago
I had this issue too.  The patch didn't apply cleanly to the current SVN 
version, 
though, and also it made a change that I had to change back (the first hunk, 
changing 
sort_by from an int to a str).  Here's the patch that worked on my system.

Thanks!

Original comment by thomat...@gmail.com on 25 Mar 2010 at 9:16

Attachments: