django-endless-pagination icon indicating copy to clipboard operation
django-endless-pagination copied to clipboard

endless pagination, multiple requests

Open durdenk opened this issue 10 years ago • 2 comments

I could use endless pagination but the thing I want is more complicated. www.zergnet.com has an example of it. There are 5 columns and everytime 15 records loaded and they are distrubuted among columns, I cant seem to be able to do that with django-endless-pagination. Since I return a template which iterates all the records,

{% include "article/util/single-article-thumbnail-new.html" %}
{% include "article/util/single-article-thumbnail-new.html" %}
{% include "article/util/single-article-thumbnail-new.html" %}
{% include "article/util/single-article-thumbnail-new.html" %}
{% include "article/util/single-article-thumbnail-new.html" %}

I need this template to iterate over 3 item and next iteration should be without those 3. This might be established with multiple requests or something? If my template was like https://dpaste.de/IrSD this one, there would be no problem at all, but this one more complicated. thx

durdenk avatar Nov 23 '13 11:11 durdenk

split result?

context = {
    'result': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..., n]
}

to

context = {
    'result1': [1, 2, 3, ..., n/5*1],
    'result2': [n/5*1+1, ..., n/5 * 2],
    ...
}

then pagenation1, pagenation2, ...

mozillazg avatar Nov 29 '13 08:11 mozillazg

The tests include an scene maybe can help you: https://github.com/frankban/django-endless-pagination/tree/master/tests/project/templates/chunks online example: http://endless.3sd.me/chunks/

mozillazg avatar Nov 30 '13 03:11 mozillazg