Repository: Shopify/shopify_python_api

Issue:
metafields() method should be able to take options parameters for limit and page
```
import shopify
product = shopify.Product.find(5972485446)
metafields = product.metafields()
print(len(metafields))
> 50
metafields = product.metafields(limit=250)
> TypeError: metafields() got an unexpected keyword argument 'limit'
```
I looked into the code, and it seems like it may be a simple fix. If I come up with something I'll submit a pull request, if I can't I'll let it be known here so somebody else can try tackling it.

Discussion:

Patch:
diff --git a/shopify/mixins.py b/shopify/mixins.py
index 9d3c179..c7806a0 100644
--- a/shopify/mixins.py
+++ b/shopify/mixins.py
@@ -11,8 +11,15 @@ class Countable(object):
 
 class Metafields(object):
 
-    def metafields(self):
-        return shopify.resources.Metafield.find(resource=self.__class__.plural, resource_id=self.id)
+    def metafields(self, _options=None, **kwargs):
+        if _options is None:
+            _options = kwargs
+        return shopify.resources.Metafield.find(resource=self.__class__.plural, resource_id=self.id, **_options)
+
+    def metafields_count(self, _options=None, **kwargs):
+        if _options is None:
+            _options = kwargs
+        return int(self.get("metafields/count", **_options))
 
     def add_metafield(self, metafield):
         if self.is_new():


Test patch:
diff --git a/test/fixtures/metafields_count.json b/test/fixtures/metafields_count.json
new file mode 100644
index 0000000..a113c32
--- /dev/null
+++ b/test/fixtures/metafields_count.json
@@ -0,0 +1,1 @@
+{"count":2}
diff --git a/test/product_test.py b/test/product_test.py
index c48962a..dcc9ae7 100644
--- a/test/product_test.py
+++ b/test/product_test.py
@@ -28,6 +28,26 @@ class ProductTest(TestCase):
         for field in metafields:
             self.assertTrue(isinstance(field, shopify.Metafield))
 
+    def test_get_metafields_for_product_with_params(self):
+        self.fake("products/632910392/metafields.json?limit=2", extension=False, body=self.load_fixture('metafields'))
+
+        metafields = self.product.metafields(limit=2)
+        self.assertEqual(2, len(metafields))
+        for field in metafields:
+            self.assertTrue(isinstance(field, shopify.Metafield))
+
+    def test_get_metafields_for_product_count(self):
+        self.fake("products/632910392/metafields/count", body=self.load_fixture('metafields_count'))
+
+        metafields_count = self.product.metafields_count()
+        self.assertEqual(2, metafields_count)
+
+    def test_get_metafields_for_product_count_with_params(self):
+        self.fake("products/632910392/metafields/count.json?value_type=string", extension=False, body=self.load_fixture('metafields_count'))
+
+        metafields_count = self.product.metafields_count(value_type="string")
+        self.assertEqual(2, metafields_count)
+
     def test_update_loaded_variant(self):
         self.fake("products/632910392/variants/808950810", method='PUT', code=200, body=self.load_fixture('variant'))