The actual reason why I need "XML RPC" is not because I need RPC. Actaully I need XML.
I need to represent SA objects in text format so systems using programming language other than python could decode them. On Mar 19, 1:27 pm, Andreas Jung <[email protected]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 19.03.2009 5:24 Uhr, 一首诗 wrote: > > > > > This is my ORM class definition: > > > #========================= > > class User(Base): > > __tablename__ = 'b_taa_user' > > > user_id = Column(Integer, primary_key=True, autoincrement=True, > > nullable=False) # 用户ID > > user_name = Column(Unicode(255), unique=True, nullable=False, > > server_default="") # 用户名称 > > user_password = Column(Unicode(255), nullable=False, > > server_default="") # 用户密码 > > email = Column(Unicode(255), nullable=False, server_default="") # 邮 > > 箱 > > mobile = Column(Unicode(255), nullable=False, server_default="") # > > 手机 > > phone = Column(Unicode(255), nullable=False, server_default="") # 电 > > 话 > > > def __init__(self, user_name = ""): > > self.user_name = username > > #========================= > > > I made some debug by the code below: > > > #========================= > > > #!/usr/bin/python > > > import xmlrpclib > > from blf.model import User > > > u = User('333') > > s = xmlrpclib.dumps((u,), methodresponse=True, allow_none=True) > > print s > > #========================= > > > Finally, I found that the first problem is : xmlrpclib only serialize > > type *instance*. > > But to my surprise, when I check type of u, it's a *class* object. > > Don't know why ... > > Sending mapped instances over XMLRPC is basically nonsense. XMLRPC is > designed for transporting elementary datatypes over the wire in order to > invoke a remote method. It is not designed for sending instances of some > class and not for sending Python pickles. No idea what you are trying to > accomplish. Consider converting a mapped instance to dict and sending > this dict serialized in JSON format to a remote XMLRPC server. > > - -aj > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (Darwin) > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/ > > iEYEARECAAYFAknB17UACgkQCJIWIbr9KYwARgCeJ1VuU6Gi9p+GVkYQzZiVWMd3 > aJoAoMwJUc8lIyOBhDwJVq3/L3QzuRoK > =aihX > -----END PGP SIGNATURE----- > > lists.vcf > < 1KViewDownload --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
