Hi, i have a table that has about 150000 rows. i want to paginate the data in this table like this.
all_records = TestModel.objects.all().limit(None)page1 = all_records[0:1000]page2 = all_records[1000:2000]
all the below codes takes equal time to be performed and the time is equal to reading all the records.
all_records[0]all_records[0:100]all_records[0:10000]
how to prevent this and read just the data that i need. If i do it wrong how can i do it right.
thanks in advance.
Hi, i have a table that has about 150000 rows. i want to paginate the data in this table like this.
all_records = TestModel.objects.all().limit(None)
page1 = all_records[0:1000]
page2 = all_records[1000:2000]
all the below codes takes equal time to be performed and the time is equal to reading all the records.
all_records[0]
all_records[0:100]
all_records[0:10000]
how to prevent this and read just the data that i need. If i do it wrong how can i do it right. thanks in advance.