Date-Based Generic View Oddities

2 views
Skip to first unread message

Tyson Tate

unread,
Jul 15, 2006, 10:39:53 PM7/15/06
to django...@googlegroups.com
I've been having some very strange issues with the
django.views.generic.date_based views and was wondering if anyone had
some insight as to what the problem may be. I'm using the latest SVN
on MacOS X 10.4.7 with MySQL 5.0.22 and Python 2.4.3.

I've built a simple date-based app that works fine through the admin
and all proper URLs resolve to the correct template and display the
correct data.

For the following problems, I reset the SQL for the app, ran 'syncdb'
and then ran it with 'runserver'. I added one object with a date and
time of today.

1. In the date_based.archive_index view, the 'date_list' object is
empty. It should have a date object for this year because there is,
of course, a post in the current year (2006). The docs for this extra
context variable state that this should contain: "all years that have
objects available according to queryset".

2. In the date_based.archive_month view, previous_month is set to the
previous month even though there are no objects in June. The docs say
that this is the expected behavior, but why? It seems to me to be
completely illogical to me because the usual use of next_month and
previous_month is to create links to archive_month views. How should
I work around this when the user is looking at the *true* last
month's worth of entries? Do we need {% if
previous_month_but_for_reals_this_time_please_i_really_mean_it %}?

3. In the date_based.archive_day view, I have the same issue with
"previous_day" as I do with previous_month. Why such tomfoolery?
Perhaps I'm off my rocker and am missing something obvious here?

Thanks in advance for any help/suggestions,
Tyson Tate

--
Tyson Tate
- CalPoly Graphic Design Student
- Work: Graphic Designer (CalPoly Library)
- Play: Mustang Band, CalPoly Triathlon Team, Kappa Kappa Psi (Iota Pi)

Reply all
Reply to author
Forward
0 new messages