-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
I recently ran across a problem where a customer has 100 skus for a product. The API only allows me to get the first 50.
opts.update({"limit": 50, "page": 1})
for product in self.con.Products.all(**opts):
for sku in product.skus():
print sku
It would be nice if we could pass parameters to the sub resource's all/get method and have it cascade to the connection instance to perform the gets
stop = False
skuopts = {"limit": 50, "page": 1}
while not stop:
for sku in product.skus(**skuopts):
print sku
My other option would be to iterate using the SubResource explicitly and passing in the product id and the product's connection, but the connection property is privatized.
opts.update({"limit": 50, "page": 1})
for product in self.con.Products.all(**opts):
stop = False
skuopts = {"limit": 50, "page": 1}
while not stop:
for sku in self.con.ProductSkus.all(product.id, product._connection, **skuopts):
print sku
This would require exposing the connection object from within the parent resource.
Metadata
Metadata
Assignees
Labels
No labels