Updating Pagination

New Member
1 0 0

Hey Guys,

I recently took over updating a website for someone and I am dealing with their old code. It looks like I have to update the pagination. I am using python 3.5 and I am just wondering how to start with this. 

 productCount = shopify.Product.count()
    #print(productCount) #TESTING
    i = 1
    pages = (productCount / 50) + 2
    #pages = (productCount / 250) + 1 #TESTING, use for partial listing requests to speed up
    products = shopify.Product.find(page=i)
    print('page ' + str(i))
    i+=1
    while( i < pages ):
        products += shopify.Product.find(page=i)
        products += (requests.get('https:/private:private@private.myshopify.com/admin/api/2019-10/products.json?limit=250&page='.i))
        print("page " + str(i))
        i+=1
    print(products)
    return products
0 Likes