【问题标题】:How can I use the Shopify python api adapter to pull assets?如何使用 Shopify python api 适配器来拉取资产?
【发布时间】:2012-10-27 02:43:57
【问题描述】:

Shopify Python API on Github

我能够做到这一点并提取所有资产的列表,但无法弄清楚如何从这里实际提取它们。有什么想法吗?

SHOP_NAME = "SHOP-NAME"
API_PASSWORD = "API-PASSWORD"
session = shopify.Session(SHOP_NAME)
session.token = API_PASSWORD
shopify.ShopifyResource.activate_session(session)

assets = shopify.Asset.find()

【问题讨论】:

    标签: python api shopify


    【解决方案1】:

    shopify.Asset.find() 正在使用不包括资产价值的list endpoint,听起来这就是您所追求的。

    如果你使用receive a single Asset端点,那么你也可以获得资产值。

    asset = shopify.Asset.find(assets[0].key, theme_id=assets[0].theme_id)
    print asset.value
    

    【讨论】:

    • 谢谢!我最终能够弄清楚这一点,但忘记发布答案。
    猜你喜欢
    • 2013-01-17
    • 2017-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-07
    • 1970-01-01
    • 1970-01-01
    • 2018-02-05
    相关资源
    最近更新 更多