advanced generic view with request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
def news_not_active(request,year,month,day):
kwargs = {}
kwargs['queryset'] = News.objects.filter(active=0).order_by('-id')
kwargs['date_field'] = 'date'
kwargs['year'] = year
kwargs['month'] = month
kwargs['day'] = day
kwargs['month_format'] = '%m'
kwargs['day_format'] = '%d'
kwargs['template_name'] = 'news_not_active.html'
return archive_day(request,**kwargs)