我有一个shopify商店和一个用django写的管理员应用程序。 python api运行良好。但是,我还没有探索过“订单”。这是我尝试过的,我得到的错误......任何想法为什么 - 以及如何解决?
>>> o = shopify.Order.find(id=1402)
错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/pyactiveresource/activeresource.py", line 351, in find
return cls._find_every(from_=from_, **kwargs)
File "/Library/Python/2.7/site-packages/pyactiveresource/activeresource.py", line 490, in _find_every
prefix_options)
File "/Library/Python/2.7/site-packages/pyactiveresource/activeresource.py", line 521, in _build_list
resources.append(cls(element, prefix_options))
File "/Library/Python/2.7/site-packages/shopify/base.py", line 133, in __init__
return super(ShopifyResource, self).__init__(attributes, prefix_options)
File "/Library/Python/2.7/site-packages/pyactiveresource/activeresource.py", line 328, in __init__
self._update(attributes)
File "/Library/Python/2.7/site-packages/pyactiveresource/activeresource.py", line 904, in _update
attr = [klass(child) for child in value]
File "/Library/Python/2.7/site-packages/shopify/base.py", line 133, in __init__
return super(ShopifyResource, self).__init__(attributes, prefix_options)
File "/Library/Python/2.7/site-packages/pyactiveresource/activeresource.py", line 328, in __init__
self._update(attributes)
File "/Library/Python/2.7/site-packages/pyactiveresource/activeresource.py", line 904, in _update
attr = [klass(child) for child in value]
File "/Library/Python/2.7/site-packages/shopify/base.py", line 132, in __init__
prefix_options, attributes = self.__class__._split_options(attributes)
File "/Library/Python/2.7/site-packages/pyactiveresource/activeresource.py", line 431, in _split_options
for key, value in options.iteritems():
AttributeError: 'str' object has no attribute 'iteritems'
答案 0 :(得分:0)
我想出来了 - 这可能是旧版ShopifyAPI版本中的一个错误。
一个简单的
easy_install -U ShopifyAPI
解决了这个问题。
希望这有帮助。