All pastes #123372 Raw Edit

randomusers's post

public python v1 · immutable
·published 2006-08-09 07:17 UTC
rendered paste body
Okay, here's the relevant parts of urls.py:announcement_dict = {	'queryset': Announcement.objects.all(),	'date_field': 'posted_on',}urlpatterns = patterns('django.views.generic.date_based',	(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<slug>[\w-]+)/$',	'object_detail', dict(announcement_dict, slug_field='slug')),	(r'^(?P<year>\d{4})/(?P<month>\d{1.2})/(?P<day>\d{1,2})/$',						'archive_day',   announcement_dict),	(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$',										'archive_month', announcement_dict),	(r'^(?P<year>\d{4})/$',															'archive_year',  announcement_dict),	(r'^/?$',																		'archive_index', announcement_dict),)This is the get_absolute_url function in the model:	def get_absolute_url(self):		return "/announcements/%s/%s/%s/%s/" % (self.posted_on.year, self.posted_on.month, self.posted_on.day, self.slug)This is the URL I'm trying to go to:http://127.0.0.1:8000/announcements/2006/8/8/someones-diary/