Hi,
i'm traing to serialize my called in python. This is my example:
I have this two classes:

*class User():*
*  def __init__(self, _name, _lastname):*
*       self.Name = _name*
*       self.LastName = _lastname*

*class News():*
*  def __init__(self, _news,_user):*
*       self.News = _news*
*       self.User = _user*


than i create my class in my code:

...
*myUser = User("Mario","Rossi")*
*myNews = News("My last news", myUser)*

*JSONstring = dumps(myNews)*
...

but in the last line of code i get the error that the News class is not
JSON serializable.

How I can make this work?

Thanks.

Regards

Marco
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a