无法在视图中访问对象ID

时间:2014-05-04 19:26:48

标签: django

URLdispatch:

url(r'^comment/(?P<slug>[\w-]+)/(?P<comment_pk>)\d+$', comment_delete, name='comment_delete')

查看功能:

def comment_delete(request, gslug, slug, comment_pk):

comment_pk的值是空白的,即使我在模板中的链接中看到了正确的ID号

模板网址标记

{% url 'comment_delete' group_profile.slug discussion.slug comment.pk %}

0 个答案:

没有答案