Re: [pylons-discuss] Re: TypeError: ObjectId() is not JSON serializable

2014-05-19 Thread Jonathan Vanasco
long day... i meant that at some point you may be using a variety of scripts/apps that somehow interact with your project (celery, twisted, etc). If you rely on the pyramid rendering framework for this, you essentially become dependent on Pyramid for this. If you have a standalone package t

Re: [pylons-discuss] Re: TypeError: ObjectId() is not JSON serializable

2014-05-19 Thread Michael Merickel
On Mon, May 19, 2014 at 10:01 PM, Jonathan Vanasco wrote: > The pyramid adapter method is perfectly fine, but at some point you may > need to write (not just render) JSON objects too. I have no idea what you mean by writing vs rendering json objects but hopefully you know that you can do json_ob

Re: [pylons-discuss] Re: TypeError: ObjectId() is not JSON serializable

2014-05-19 Thread Jonathan Vanasco
On Monday, May 19, 2014 7:06:20 PM UTC-4, Randall Leeds wrote: > > > http://docs.pylonsproject.org/projects/pyramid/en/master/narr/renderers.html#using-the-add-adapter-method-of-a-custom-json-renderer > > FWIW, I found it more beneficial to use a custom JSON serializer and make it available vi

Re: [pylons-discuss] Re: TypeError: ObjectId() is not JSON serializable

2014-05-19 Thread Randall Leeds
http://docs.pylonsproject.org/projects/pyramid/en/master/narr/renderers.html#using-the-add-adapter-method-of-a-custom-json-renderer On May 19, 2014 6:55 PM, "Yannick" wrote: > Basically what I did I parse the resultset and for each row I convert the > ObjectId to String and it works. > But do you

[pylons-discuss] Re: TypeError: ObjectId() is not JSON serializable

2014-05-19 Thread Yannick
Basically what I did I parse the resultset and for each row I convert the ObjectId to String and it works. But do you know a more efficient way to handle this situation ? On Monday, May 19, 2014 6:40:46 PM UTC-4, Yannick wrote: > > Hello mate, > > I'm rendering my Python function to JSON. Inside

[pylons-discuss] TypeError: ObjectId() is not JSON serializable

2014-05-19 Thread Yannick
Hello mate, I'm rendering my Python function to JSON. Inside the function I got data from mongodb as following: @view_config(route_name='listdisplay', renderer='json') def matchFactStat(request): rs = request.db.collection.find() return list(playerMatchStatList) When I do that I have