int() can't convert non-string with explicit base
Exception Type: TypeError Exception Value: int() can't convert non-string with explicit base Exception Location: C:\Python27\lib\site-packages\sugarcrm\sugarmodule.py in _search, line 101
getting this error, any idea?
my code: def get_all_accounts(cls): accounts_list = [] accounts = cls.sugarcrm_connection['Accounts'].query() for account in accounts[:3]: accounts_list.append(account['name'])
return accounts_list
What version of SugarCRM are you using? On my system the responses to get_entry_list include a total_count that is in string format, so it's being parsed from the string into an integer for comparison. If something's changed in the latest version of Sugar the library may need some adjustment.
@gddc It can be integer (-1). We are also facing the same issue. Please let us know when you are planning to fix this issue.
I can't seem to prompt my system to return -1 for calls into that function, but I've removed the explicit base in the conversion to an integer in that line. I believe that should resolve this. If you would care to test with the latest code and let me know how you fare.
Hi thanks for your reply, i use sugarcrm6.5 anv v4 api too, after you commit i get this error File "C:\Python27\lib\site-packages\sugarcrm\sugarmodule.py", line 173, in next self._total = result['total'] KeyError: u'total'
i use this module with Django1.9 , my Python version is 2.7.11
It would really help to know what the content of result in the line above was in your situation - it seems as though the responses from your system are not in line with the normal expectations - I've never encountered errors at those particular functions. In any event, I've added some defensive code to that area of the retrieval if you'd care to test with the latest.