RussellJuma / PySuiteCRM

MIT License
10 stars 4 forks source link

Error on importing SuiteCRM #3

Closed Hiranyaloka closed 2 years ago

Hiranyaloka commented 2 years ago

Hi. I'm fairly new to Python. Thanks for your very useful module. I'm on Python 3.8:

Traceback (most recent call last):
  File "./inquiries.py", line 4, in <module>
    import crm
  File "/home/rick/crm-sync/crm.py", line 13, in <module>
    from PySuiteCRM.SuiteCRM import SuiteCRM
  File "/home/rick/crm-sync/__pypackages__/3.8/lib/PySuiteCRM/SuiteCRM.py", line 152, in <module>
    class Module:
  File "/home/rick/crm-sync/__pypackages__/3.8/lib/PySuiteCRM/SuiteCRM.py", line 189, in Module
    def get(self, fields: list = None, sort: str = None, **filters) -> list[dict]:
TypeError: 'type' object is not subscriptable

Error goes away when I removed the parenthesis from "list([dict])" in two places in SuiteCRM.py:

$ diff SuiteCRM.py SuiteCRM.py_original
189c189
<     def get(self, fields: list = None, sort: str = None, **filters) -> list([dict]):
---
>     def get(self, fields: list = None, sort: str = None, **filters) -> list[dict]:
226c226
<     def get_all(self, record_per_page: int = 100) -> list([dict]):
---
>     def get_all(self, record_per_page: int = 100) -> list[dict]:
Hiranyaloka commented 2 years ago

Yikes. I meant that I had to add the parenthesis to dispel the error.

RussellJuma commented 2 years ago

Yikes. I meant that I had to add the parenthesis to dispel the error.

I resolved the issue. Was a problem in regards to https://peps.python.org/pep-0563/. Pushing to pypi, pull in about 1 hour.

Hiranyaloka commented 2 years ago

Thanks Russell!

I'm using your module to pull our WordPress form inquiries into SuiteCRM leads. Next up is syncing CRM contacts with our MailChimp and a "SchoolInfoApp" service (we're a K-8 private school). Your work is saving me a lot of time. Much appreciated!

On July 11, 2022 10:02:51 PM PDT, Russell Juma @.***> wrote:

Yikes. I meant that I had to add the parenthesis to dispel the error.

I resolved the issue. Was a problem in regards to https://peps.python.org/pep-0563/. Pushing to pypi, pull in about 1 hour.

-- Reply to this email directly or view it on GitHub: https://github.com/RussellJuma/PySuiteCRM/issues/3#issuecomment-1181316916 You are receiving this because you authored the thread.

Message ID: @.***>