【问题标题】:shopify.Order.find(id=1400) returns error? Any ideas what might be wrong?shopify.Order.find(id=1400) 返回错误?有什么想法可能是错的吗?
【发布时间】:2013-07-14 15:44:11
【问题描述】:

我有一个 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'

【问题讨论】:

    标签: python shopify


    【解决方案1】:

    我想通了 - 这可能是旧版 ShopifyAPI 中的一个错误。

    一个简单的

    easy_install -U ShopifyAPI

    永久修复此问题。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-04-07
      • 2011-07-08
      • 2011-08-20
      • 2021-01-08
      • 2011-07-06
      • 2019-01-05
      • 1970-01-01
      • 2020-03-13
      • 1970-01-01
      相关资源
      最近更新 更多