Hi guys,
I'm having trouble updating the value of an asset using the python version of ShopifyAPI. I'm not sure if I'm doing something wrong, but I couldn't find many examples of updating objects via the API.
Here's what I'm doing:
asset = shopify.Asset.find(remote_path, theme_id=theme_id)
asset.value = "new contents"
asset.save()
Asset.find() pulls the file contents correctly, but updating the value attribute doesn't seem to be updating the file on the server.
After the asset.save() call an 'attachment' attribute appears to be added to the asset object containing the base64 encoded value of the new file contents, and the 'value' attribute is also still there with the
original value.
Also, the theme ID doesn't seem to be being passed in the XML request to the server during the save() call. I found another similar topic regarding this (
https://groups.google.com/forum/#!searchin/shopify-api/ShopifyAPI$20asset/shopify-api/Kvxt1nL6nls/P1mlENlIY_QJ) which gives me the impression that it's meant to be there. I can't work out how to replicate the authors workaround in the python version of activeresource though.
Would appreciate any help.
Thanks!
Richard