Y
Y
Yes2019-10-07 11:08:18
Django
Yes, 2019-10-07 11:08:18

What is the best way to do pagination?

I am using Django. As a result of sampling more than 20 records. The standard Django admin + Jet can't handle that much data. The page is loaded for a very long time, and when, through ForeginKey, I select records from this list in the select box, the page generally freezes. From the HTML side.
I decided to make my own admin panel, but the question arose of how to organize pagination:
1) Through return render (), transfer all objects and iterate in the template through for
2) Make pagination through ajax.
But even choosing the right pagination option will not solve the whole problem. There is a select box (html tag) in which there are ~ 20k records, and it is when working with it that the page stops responding. Can this be optimized somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-10-07
@volkihar

The page is loaded for a very long time, and when, through ForeginKey, I select records from this list in the select box, the page generally freezes.

raw_id_fields + list_per_page

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question