你知道为什么它在返回行中显示无效语法吗?一切似乎都很好,我检查了。如果缩进有问题,我已经用空格替换了制表符。
def detail(request, sl):
try:
post = Post.objects.filter(slug=sl)[0]
try:
previous_post = post.get_previous_by_published()
except:
previous_post = ""
try:
next_post = post.get.next_by_published()
except:
next_post = ""
return render_to_response('blog/detail.html',{'post':post,
'next_post':next_post,
'previous_post':previous_post,
},)
提前致谢。