문제

django contrib.comments에 대한 기존 페이지 매김 솔루션이 있습니까?

내가 필요로하는 것은 단순한 Paginated Django 댓글입니다. 간단한 has_previous 및 has_next

Django.contrib.comments를 복사하고 코드를 수정했지만 성공하지 못했습니다. 코드는 이해하기 어렵습니다 (Django/Contrib/Comments/TemplateTags/Comments.py)은 노드 및 파서로 구성되어 있기 때문입니다.

다음은 내 의견입니다 .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 템플릿 태그 :)

미리 감사드립니다

도움이 되었습니까?

해결책

나는 장고-지분이 당신이 찾고있는 것일 수 있다고 생각합니다.

http://code.google.com/p/django-pagination/ (스크린 캐스트 사용 가능)

다른 팁

Django는 또한 매출 시스템이 내장되어 있습니다

https://docs.djangoproject.com/en/dev/topics/pagination/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top