销售或电子商务:如何通过python代码或API批量插入产品

2024-09-24 00:32:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在saleor电子商务cms上做一些测试,通过python从cvs文件自动添加一些产品 不巧的是,我只找到了一些用于从数据库Saleor Product Bulk upload script读取现有产品的graphqlapi示例,但是我找不到任何添加GraphQL API产品的例子。 有什么建议吗?在


Tags: 文件数据库示例cms产品scriptbulkproduct
2条回答

pytest fixture简要介绍了如何在python-https://github.com/mirumee/saleor/blob/master/tests/conftest.py#L389中以编程方式创建产品

另外,我不认为批量api存在于添加产品。从代码中我可以看出它们是用来删除和管理的-https://github.com/mirumee/saleor/blob/master/saleor/graphql/product/bulk_mutations/products.py

With the DEBUG=True setting enabled, Saleor exposes an interactive GraphQL editor under /graphql, that allows accessing the API from the browser.

文档中可能有(99,9%)错误:应该是/graphiql(vs/graphql-指向API)启用时在浏览器中显示"graphql-playground-react"-“行业标准”(修改后的知名graphiql)工具,用于尝试查询、探索类型、可用的变异等

浏览(或只是开始输入)“突变产品创建{`。这是一种可以用于生成批处理更新的单产品方法。在

在playground(使用变量-检查graphiql文档)中尝试您的突变,然后从代码开始。在

相关问题 更多 >