Karen,

That makes total sense.  I really missed the verbiage there.

Thanks.

On Jun 30, 10:34 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> On Tue, Jun 30, 2009 at 1:55 PM, Seth Buntin <sethtr...@gmail.com> wrote:
>
> > I'm having an issue with the date_based generic views archive_index.
> > I am expecting the context to return a date_list with datetime
> > instances of the years specified in my queryset.
>
> > The problem is my queryset doesn't return what I am expecting.  The
> > queryset only has one instance and it has a datefield values of June
> > 6, 2009 the only date object I get in date_list is an object for
> > January 1, 2009. Any ideas on what might be causing this?
>
> This is what I'd expect base on the documentation.
>
> http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-...
>
> says date_list is "A list of datetime.date objects representing all years
> that have objects available according to queryset. These are ordered in
> reverse. This is equivalent to queryset.dates(date_field, 'year')[::-1]."
>
> Looking up queryset.date 
> (http://docs.djangoproject.com/en/dev/ref/models/querysets/#dates-fiel...),
> when you specify kind as "year", it says what will be generated is a list of
> all distinct year values for the field.  The example for kind="year" shows
> datetime.date value of Jan 1 for the single year in the example set (the
> full set in the example has multiple dates in the same year).
>
> Note the only significant value in the datetimes returned is the year, but
> the month and day have to have values set to something (since Python doesn't
> support a datetime.date with only the year part specified), so they are
> arbitrarily set to 1 and 1.  This does not mean there is necessarily any
> instance in the queryset that has that exact date, it simply means there is
> at least one (perhaps more) instance within the queryset with a date in that
> year.
>
> Karen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to