I have Grid-view it only show 10 records on time .
What is the best way to get from database only 10 rows?
Is MyModel.objects.all()[10:20] approprate .
I have Grid-view it only show 10 records on time .
What is the best way to get from database only 10 rows?
Is MyModel.objects.all()[10:20] approprate .
You are doing it correctly. The django docs also have examples on this.
>>> Entry.objects.all()[5:15]
Since I don't know your use case, maybe pagination is also something that might suite your needs.