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 = m
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 empt
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:
>
> cla
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:
class Book(models.Model):
name = models.CharField(max_length=300)
pages = models.IntegerField()
price = models.DecimalField(max_digits=10, decimal_places=2)
rating = models.FloatField()
pubdate = models.DateField()
and I run the query:
Book.obj
5 matches
Mail list logo