Anonymous     Python     07 Oct 2008    
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
def show_post(request, year, month, day, slug):
kwargs = {}
kwargs['queryset'] = Post.objects.all()
kwargs['extra_context'] = {'posts': Post.objects.all()[:10]}
kwargs['slug'] = slug
kwargs['slug_field'] = 'slug'
kwargs['date_field'] = 'date'
kwargs['year'] = year
kwargs['month'] = month
kwargs['day'] = day
kwargs['month_format'] = '%m'
kwargs['day_format'] = '%d'
kwargs['template_name'] = 'blog/show_post.html'
return object_detail(request, **kwargs)