- The implementation overfetches an object and uses that to determine if next page is present.
𝚍𝚎𝚏 𝚙𝚊𝚐𝚎(𝚜𝚎𝚕𝚏, 𝚗𝚞𝚖𝚋𝚎𝚛):
...
𝚋𝚘𝚝𝚝𝚘𝚖 = (𝚗𝚞𝚖𝚋𝚎𝚛 - 𝟷) * 𝚜𝚎𝚕𝚏.𝚙𝚎𝚛_𝚙𝚊𝚐𝚎
𝚝𝚘𝚙 = 𝚋𝚘𝚝𝚝𝚘𝚖 + 𝚜𝚎𝚕𝚏.𝚙𝚎𝚛_𝚙𝚊𝚐𝚎 + 𝟷
...
- Can also be applied to ORMS other than Django for optimizing performance.
(2/2)
- The implementation overfetches an object and uses that to determine if next page is present.
𝚍𝚎𝚏 𝚙𝚊𝚐𝚎(𝚜𝚎𝚕𝚏, 𝚗𝚞𝚖𝚋𝚎𝚛):
...
𝚋𝚘𝚝𝚝𝚘𝚖 = (𝚗𝚞𝚖𝚋𝚎𝚛 - 𝟷) * 𝚜𝚎𝚕𝚏.𝚙𝚎𝚛_𝚙𝚊𝚐𝚎
𝚝𝚘𝚙 = 𝚋𝚘𝚝𝚝𝚘𝚖 + 𝚜𝚎𝚕𝚏.𝚙𝚎𝚛_𝚙𝚊𝚐𝚎 + 𝟷
...
- Can also be applied to ORMS other than Django for optimizing performance.
(2/2)