On Tuesday 17 January 2006 01:04, Bryan Murdock wrote: > I'm building myself a little blog with the django blog app that is > found in the djangoproject.com code. I like the archive links (seen > on the right-hand side of http://www.djangoproject.com/weblog/). > However, I'd like those links auto-generated according to whether > there are blog entries for those dates. As it stands now, I'd have to > put those links in by hand, and if I put in a link to, say, > /2005/dec/, and there were no blog entries posted in December 2005, > that link returns a 404 (using the date-based generic view). Any > recommendations on how to automate this and avoid 404 links?
You probably want to check out the 'get_latest_blog_entries' templatetag in djangoprojects/apps/blog/templatetags/latestblogentry.py. -John