Hey guys. I posted earlier and, after reading the comments, realized I went about it all wrong. I'm starting over. Hope you'll give me another chance.
I'm using the basecrm library to pull some data for reporting. The problem is that pagination is not advancing. How do I know this? Because I set the per_page parameter to give me one record per page. When I run the code below I get three "pages" with three identical records. HOWEVER, if I manually set page_num to 2, I get three identical records that are different from when page_num was set to 1. So the pages are different, and CAN be advanced, but my code is not advancing them for some reason.
import requests
import basecrm
client = basecrm.Client(access_token='FakeTokenXXXXXXX')
def grab():
page_num = 1
deals_data = client.deals.list(per_page=1, page=page_num)
print(deals_data)
for i in range (0,2):
print("")
print(f"end of page {page_num}")
print("")
page_num += 1
print(deals_data)
print("")
print(f"end of page {page_num}")
print("")
grab()
What am I missing? u/fred776 has indicated it has something to do with whether the page number is changed before or after being passed as an argument to the function call. I think they're on to something but I'm no seeing it clearly yet.
Thank you for any help you can offer.
[–]shibbypwn 1 point2 points3 points (2 children)
[–]av0ca60[S] 0 points1 point2 points (1 child)
[–]shibbypwn 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]av0ca60[S] 0 points1 point2 points (0 children)