我正在将应用程序从 django 1.8 和 python 2.7 移植到 django 2.2 和 PYTHON 3.6
这是在 python 2.7 中
def get_absolute_url(self):
return ('threads_reply', [self.id])
get_absolute_url = models.permalink(get_absolute_url)
我也改了
def get_absolute_url(self):
return django.urls.resolve('threads_reply', [self.id])
它现在崩溃了
@login_required
def inbox(request, template_name='django_messages/inbox.html'):
"""
Displays a list of received messages for the current user.
Optional Arguments:
``template_name``: name of the template to use.
"""
thread_list = Thread.objects.inbox_for(request.user)
return render(request, template_name, {
'thread_list': thread_list,
})
慕虎7371278
相关分类