Django contrib.comments是否有任何現有的分頁解決方案?Django分頁評論..有沒有現有的解決方案?
我需要的只是一個簡單的分頁Django的意見,爲我所用的基本的博客應用(從Django的基本應用程序),使用simple has_previous and has_next
我抄django.contrib.comments,並試圖修改代碼但沒有成功。該代碼是非常難以理解(Django的/的contrib /評論/ templatetags/comments.py),因爲它是由節點和解析器
這裏是我使用的博客應用我comments.html模板:
{% load comments markup %}
{% get_comment_list for object as comment_list %}
{% if comment_list %}
<div class="comments g_7 left">
<a name="comments"></a>
<div class="subtitle">Comments</div>
{% for comment in comment_list %}
{% if comment.is_public %}
<div class="comment g_6" id="c{{ comment.id }}">
<div class="comment_name g_6">
<div class="comment_count right">
<a name="c{{ comment.id }}" href="{{ comment.get_absolute_url }}" {% ifnotequal comment.person_name null %}title="Permalink to {{ comment.person_name }}'s comment"{% endifnotequal %} class="comment_count">{{ forloop.counter }}</a></div>
Wrote by <strong>{% if comment.user_url %}<a href="{{ comment.user_url }}">{{ comment.user_name }}</a>{% else %}{{ comment.user_name }}{% endif %}</strong> on {{ comment.submit_date|date:"F j, Y" }} - {{ comment.submit_date|date:"P" }}
</div>
<div class="comment_body g_6">{{ comment.comment|urlizetrunc:"60"|safe }}</div>
</div>
{% endif %}
{% endfor %}
<div class="clear"></div>
</div>
{% else %}
No comments yet.
{% endif %}
我認爲問題出在get_comment_list templatetags :)提前
您好,感謝的答案:) 其實我在尋找具體的評論分頁,以前有人可能會這樣做(我認爲評論是一種常見功能,有人必須在評論解決方案中完成分頁),但我認爲您給我的鏈接可以提供解決方法:) 我會盡量玩它。謝謝! – 2009-06-23 06:17:48