10000 Added filter limit, defaults to -1 · woocommerce/wc-api-python@572613f · GitHub
[go: up one dir, main page]

Skip to content

Commit 572613f

Browse files
author
Javier
committed
Added filter limit, defaults to -1
1 parent bffe8d7 commit 572613f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

woocommerce/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def __init__(self, url, consumer_key, consumer_secret, **kwargs):
2727
self.timeout = kwargs.get("timeout", 5)
2828
self.verify_ssl = kwargs.get("verify_ssl", True)
2929
self.query_string_auth = kwargs.get("query_string_auth", False)
30+
self.filter_limit = kwargs.get("filter_limit", "-1")
3031

3132
def __is_ssl(self):
3233
""" Check if url use HTTPS """
@@ -81,6 +82,8 @@ def __request(self, method, endpoint, data):
8182
data = jsonencode(data, ensure_ascii=False).encode('utf-8')
8283
headers["content-type"] = "application/json;charset=utf-8"
8384

85+
url += '?filter[limit]=%s' %(self.filter_limit)
86+
8487
return request(
8588
method=method,
8689
url=url,

0 commit comments

Comments
 (0)
< 107 /div>
0