labd / commercetools-python-sdk

Commercetools Python SDK
https://commercetools-python-sdk.readthedocs.io/en/latest/
MIT License
17 stars 16 forks source link

Readme Example Isn't Working #114

Closed siamalekpour closed 3 years ago

siamalekpour commented 3 years ago

Hi,

First off, thank you for your work on this SDK.

I was playing around with the latest update from yesterday, specifically this piece of code in the README.rst:

product = (
    client
    .with_project_key("<your-project-key>")          # Error 1
    .products()                                      # Error 2
    .with_id("00633d11-c5bb-434e-b132-73f7e130b4e3") # Error 3
    .get()
)

Adding and removing lines from that code, here are the different errors I see:

  1. AttributeError: 'Client' object has no attribute 'with_project_key'
  2. TypeError: 'ProductService' object is not callable
  3. AttributeError: 'ProductService' object has no attribute 'with_id'

However, the old client syntax still works:

product = client.products.get_by_id(id)

I'd appreciate any advice on how to fix this issue.

Python Version: 3.8.2 SDK Version: 13.0.0

Cheers Sia

mvantellingen commented 3 years ago

Ah Yes, forgot to fix the import statement. The old one is still working for backwards compat.

Let me know if you run into any problems

siamalekpour commented 3 years ago

It seems as if the new platform path doesn't exist in release 13.0.0.

I can, however, see it in the latest master branch.

Can you please update the latest release to reflect the latest changes seen in the readme and the master branch?