Re: .dates() bug or feature?

2010-09-29 Thread dPeS
> Order matters when it comes to annotation.  Read this section very > carefully:http://docs.djangoproject.com/en/dev/topics/db/aggregation/#order-of-... Off course order matters, but in this case annotate adds some extra field to each Rezerwacja object which is irrelevant to dates grouping - the

Re: .dates() bug or feature?

2010-09-28 Thread derek
On Sep 28, 12:08 pm, dPeS wrote: > Hi all, > > Anyone has explanation to this? : > > >>> len(models.Rezerwacja.objects.all()) > 9 > >>> len(models.Rezerwacja.objects.annotate(przyjazd=Min('transza__zajetosc__dzien'))) > 9 > >>>

.dates() bug or feature?

2010-09-28 Thread dPeS
Hi all, Anyone has explanation to this? : >>> len(models.Rezerwacja.objects.all()) 9 >>> len(models.Rezerwacja.objects.annotate(przyjazd=Min('transza__zajetosc__dzien'))) 9 >>> models.Rezerwacja.objects.annotate(przyjazd=Min('transza__zajetosc__dzien')).dates('utworzona','year')