这里是我的URL模式:如何自定义基于日期的通用视图的URL?
news_info_month_dict = {
'queryset': Entry.published.filter(is_published=True),
'date_field': 'pub_date',
'month_format': '%m',
}
和
(r'^(?P<category>[-\w]+)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+).html$',
'object_detail', news_info_month_dict, 'news_detail'),
但是他们有一个错误喜欢这样的:
object_detail() got an unexpected keyword argument 'category'
请帮助我。谢谢!
对不起,函数datetime.date不接受变量。他们想要整数。 – anhtran 2009-12-04 19:09:49
我用一些int(...)修复了我的帖子,现在可能会工作! – 2009-12-05 08:21:31