Why my aggregate is not working?

2015-11-05 Thread Fellipe Henrique
Hi, I have these model: class ProductClicks(models.Model): product = models.ForeignKey(Product) dthr = models.DateTimeField(_('Date/Time Click'), auto_now_add=True) ip = models.CharField(_('IP'), max_length=20, blank=True, null=True) And this view: current_month = datetime.now().mon

Re: Why my aggregate is not working?

2015-11-05 Thread Dheerendra Rathor
Are you sure you want to use aggregate? Aggregate will return you a dictionary like {'total': 10}. Probably you want to use annotate which will return you a queryset. On Thu, 5 Nov 2015 at 22:09 Fellipe Henrique wrote: > Hi, I have these model: > > class ProductClicks(models.Model): > produc