@nurzhannogerbek

Как исправить ошибку при скроллинге в приложении django-el-pagination?

Здравствуйте, помогите решить проблему.

Использую бесконечный скроллинг приложения django-el-pagination.

Когда пользователь достигает последней страницы в терминале появляется ошибка:
Time: [25/Jan/2018 08:37:38] | LevelName: DEBUG | Module: base | Process: 1148 | Thread: 123145435922432 | Message: Exception while resolving variable 'querystring' in template 'documents/documents.html'.
Traceback (most recent call last):
  File "/Users/nurzhan_nogerbek/Virtualenvs/py2714/lib/python2.7/site-packages/django/template/base.py", line 903, in _resolve_lookup
    (bit, current))  # missing attribute
VariableDoesNotExist: Failed lookup for key [querystring] in u"[{'False': False, 'None': None, 'True': True}, {'csrf_token': <SimpleLazyObject: <function _get_val at 0x109034ed8>>}]


views.py:
from el_pagination.views import AjaxListView

class DocumentListView(AjaxListView):
    context_object_name = 'documents'
    template_name = "documents/main.html"
    page_template = 'documents/documents.html'

    def get_queryset(self):
        documents = Document.objects.all()
        return documents


documents/main.html:
<div class="list-group">
    {% include page_template %}
</div>


documents/documents.html:
{% load el_pagination_tags %}

{% paginate 20 documents %}
{% for document in documents %}
    {% include "documents/list_template.html" %}
{% endfor %}
{% show_more %}


documents/list_template.html:
<div class="list-group-item">{{document.title}}</div>


Вроде ошибка из-за querystring, который используется в шаблоне тега show_more. Есть ли у вас идеи как исправить данную ошибку?
  • Вопрос задан
  • 154 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы