Shopify / Shopify/shopify_python_api

Save many metafields with a single request

オープン
#112 コメント 10 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

feature request
主要言語
Python
スター
1.4k
フォーク
388
平均マージ
5時間 39分
マージ済み PR(30日)
1

説明

There does not seem to be a way to attach metafields locally, and then simply save the product with the metafields along with it. I'm forced to use add_metafields() or Metafield().save(), both of which adds a single metafield per API call. This is very slow.

If I take a product with 50 metafields, and save it as a new product, it saves almost instantly, like so:

p = shopify.Product.find()[0]
print len(p.metafields())
> 50
p.id = None
p.images = None
p.save()

How can I attach metafields to a product in the same way they are attached when they are fetched?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず Product.save()、add_metafields()、Metafield().save() を追跡し、取得した metafields がどのように表現され、永続化されるかを理解します。ローカルにアタッチされた metafields を新しい product とともに1回の API リクエストで保存でき、報告された複数の metafields のケースをカバーできれば、作業は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
32/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。