Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attachments module: import errors, not serializable #30

Closed
arrrobase opened this issue Nov 17, 2016 · 3 comments
Closed

attachments module: import errors, not serializable #30

arrrobase opened this issue Nov 17, 2016 · 3 comments

Comments

@arrrobase
Copy link

I'm trying to send attachments following the details here but I'm running into problems. I haven't run into any other issues with Groupy on my machine, running 32 bit python 3.5.2 through Conda on Windows 10.

>>> from groupy.attachment import Location
ImportError: No module named 'groupy.attachment'

>>> from groupy import attachment
ImportError: cannot import name 'attachment'

>>> from groupy import attachments  # needs an s
>>> loc = attachments.Location.create('My house', lat=33, lng=-84)
AttributeError: type object 'Location' has no attribute 'create'

>>> from groupy import Group
>>> loc = attachments.Location('My house', lat=33, lng=-84)
>>> group = Group.list().filter(group_id=group_id)[0]
>>> group.post('test')  # this works
True

>>> group.post('test', loc)  # this doesn't
TypeError: Location(name='My house', lat=33, lng=-84) is not JSON serializable

I'm hosting my bot on Heroku, which is also throwing the same errors. Any help would be appreciated. Thanks for writing this great API wrapper.

@rhgrant10
Copy link
Owner

Thanks for pointing this out. I believe it's simply because I'm not calling each attachments' as_dict method before passing them along to the underlying api call. I should be able to push out a fix pretty soon.

@arrrobase
Copy link
Author

You were right. Calling as_dict solved the issue. Thanks!

@rhgrant10
Copy link
Owner

rhgrant10 commented Nov 20, 2016

@awctomlinson Thanks again for pointing this out. I now automatically call each attachments' as_dict method, if possible, so there's no need for the caller to do that manually. Now available in v0.7.0 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants