【发布时间】:2012-02-14 01:13:53
【问题描述】:
我正在尝试在我的表单末尾添加一个 cmets 部分,以便用户可以输入 cmets。我完全按照 Django 教程的要求:https://docs.djangoproject.com/en/dev/ref/contrib/comments/example/
但我不断收到此错误:
模板语法错误
渲染时捕获 AttributeError:“ModelFormOptions”对象没有属性“代理”
有人知道为什么吗?
这是日志:
91 {% load comments %}
92 {% get_comment_count for form as comment_count %}
93 <p>{{ comment_count }} comments have been posted.</p>
94 {% render_comment_list for form %}
95
96 {% get_comment_list for form as comment_list %}
97 {% for comment in comment_list %}
98 <p> Posted by: {{ comment.user_name }} on {{ comment.submit_date }}</p>
99
100 <p>Comment: {{ comment.comment }}</p>
101 {% endfor %}
错误发生在第 92 行
【问题讨论】:
标签: django django-models django-forms django-templates django-views