Re: problem with DateQuerySet

2008-05-14 Thread Eric Abrahamsen
Okay, now I'm thinking this has to do with date fields being either blank=True or null=True or maybe both. I have another model where the date field is blank and nullable, and there are instances in the database where the field value is Null, and doing a dates() query on that produces an er

Re: problem with DateQuerySet

2008-05-14 Thread Eric Abrahamsen
Thanks Adi, but that's not it. I've got other models in this app where plain old Model.objects.dates() works just fine, and besides, your longer version still doesn't work with my Appearance model :) I'm pasting the model definition below, just in case anything leaps out at anyone. At first

Re: problem with DateQuerySet

2008-05-14 Thread Adi Jörg Sieker
Hi Eric, On 14.05.2008, at 03:49, Eric Abrahamsen wrote: > app_years = Appearance.objects.dates('app_date','year') I don't know if it makes a difference and I'm new to django, but I've used the dates method like so: app_years = Appearance.objects.all().dates('app_date','year') and it works l

problem with DateQuerySet

2008-05-13 Thread Eric Abrahamsen
I've got a perplexing problem that I don't even know where to start fixing. Creating a DateQuerySet for one of my models produces an empty list every time. Here's at the prompt: >>> apps = Appearance.objects.all() >>> for ap in apps: ... print ap.app_date ... 2009-02-11 09:00:00 2008-06