>>> archive_index is date_list
>>> archive_year is date_list

> But archive_year doesn't return a object list


Yep...I'm actually dealing with that today. It's instead only returning
a list of datetimes that represent the months within that year that
contain objects. (ie, if it's a blog, and you have posts in Oct-Dec of
2005, then the date_list would contain datetime objects for Oct 1st,
Nov 1st, and Dec 1st, representing the months that have objects). I
guess the assumption within the framework here is that the year is a
stepping stone to the month...too many objects at the year level, so
they just give you the months to build URLs from to get to the
archive_month view easily. I'm not thrilled with it either. *grin*

I have a related issue...now that I have the datetime date_list of
months, I try to iterate over it, and it's being treated as a string:

print date_list gives me : [datetime.datetime(2005, 1, 1, 0, 0),
datetime.datetime(2005, 3, 1, 0, 0)]

for month in date_list, though, gives me
'str' object has no attribute 'month'

So it's treating date_list as a string, rather than a iterable list. I
know that "free" access to the datetime module is being removed in
magic-removal, but I'm at rev 1811...have I somehow gotten caught in
betwixt something? How/where do I import datetime; I'm using a generic
view.! Or is there something I can add in the template that I'm missing
(or something else silly that I'm missing *grin*)

Thanks for any help...I'll skirt around this for now by bailing on the
archive_year and going straight to month, but I expect it'll rear it's
head again.

Reply via email to