This bug has been solved here: https://code.djangoproject.com/ticket/20782
On Friday, July 19, 2013 11:49:52 AM UTC+5:30, Debanshu Kundu wrote:
>
> If I have a model *Book* defined as:
>
> class Book(models.Model):
>name = models.CharField(max_length=300)
>pages = models.IntegerField()
>
This bug has been solved here: https://code.djangoproject.com/ticket/20782
On Friday, July 19, 2013 10:05:46 PM UTC+5:30, Debanshu Kundu wrote:
>
> Also interestingly, if I do:
>
> Book.objects.values('rating').aggregate(Max('rating'))
>
> It returns an empty dict without performing any DB query!
Also interestingly, if I do:
Book.objects.values('rating').aggregate(Max('rating'))
It returns an empty dict without performing any DB query!!
On Friday, July 19, 2013 11:49:52 AM UTC+5:30, Debanshu Kundu wrote:
>
> If I have a model *Book* defined as:
>
> class Book(models.Model):
>name =
EDIT:
the query should be:
Book.objects.values('rating').annotate(books_per_rating=Count('id')).aggregate(Max('books_per_rating'))
*books_per_rating* should be quoted in *Max* call.
On Friday, July 19, 2013 11:49:52 AM UTC+5:30, Debanshu Kundu wrote:
>
> If I have a model *Book* defined as:
>
>
4 matches
Mail list logo