Python 属性错误位于/admin/fluent\u comments/fluentcomment/
尝试实现django_流畅的注释。它与另一个CLSS完美配合,但对于News,我有以下错误(尽管这些类基本相似): 回溯将我链接到注释模板:Python 属性错误位于/admin/fluent\u comments/fluentcomment/,python,django,django-fluent,Python,Django,Django Fluent,尝试实现django_流畅的注释。它与另一个CLSS完美配合,但对于News,我有以下错误(尽管这些类基本相似): 回溯将我链接到注释模板: Error during template rendering In template /app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/templates/admin/change_list.html, error at line 91 'News' object
Error during template rendering
In template /app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/templates/admin/change_list.html, error at line 91
'News' object has no attribute 'get_absolute_url'
我不想在“news”类中添加get_absolute_url方法,因为我不明白为什么在其他情况下没有它它它也可以工作 我没有使用django_fluent_注释,但是如果您使用
获取绝对url
,应用程序会在视图和模板中使用该方法。如果该方法不存在,则似乎不会出现回退,因此您似乎无法避免创建该方法。我没有使用django_fluent_注释,但如果您用于get_absolute_url
,则应用程序会在视图和模板中使用该方法。如果该方法不存在,则似乎没有回退,因此看起来您无法避免创建该方法。
Error during template rendering
In template /app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/templates/admin/change_list.html, error at line 91
'News' object has no attribute 'get_absolute_url'