From 572613faee7c48ab64b3ce334c3e222d7f19e64b Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 2 Jan 2018 11:36:40 +0100 Subject: [PATCH] Added filter limit, defaults to -1 --- woocommerce/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/woocommerce/api.py b/woocommerce/api.py index d15a179..ab252fa 100644 --- a/woocommerce/api.py +++ b/woocommerce/api.py @@ -27,6 +27,7 @@ def __init__(self, url, consumer_key, consumer_secret, **kwargs): self.timeout = kwargs.get("timeout", 5) self.verify_ssl = kwargs.get("verify_ssl", True) self.query_string_auth = kwargs.get("query_string_auth", False) + self.filter_limit = kwargs.get("filter_limit", "-1") def __is_ssl(self): """ Check if url use HTTPS """ @@ -81,6 +82,8 @@ def __request(self, method, endpoint, data): data = jsonencode(data, ensure_ascii=False).encode('utf-8') headers["content-type"] = "application/json;charset=utf-8" + url += '?filter[limit]=%s' %(self.filter_limit) + return request( method=method, url=url,