我正在将应用程序从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,
})
答案 0 :(得分:1)