[Twisted-Python] adbapi/postgresql and xml-rpc

Stephen Waterbury golux at comcast.net
Wed May 12 16:30:57 EDT 2004


James R. Saker Jr. wrote:

> QUESTION: While I think I could build more precise queries on the server
> side, e.g. xmlrpc_getAllSIDbyDate and massage timestamp and other
> formats before dumping into xmlrpc, this might not be the most elegant
> method. It makes every query something both ends have to be recoded for
> - not just the client - simply because I can't get timestamp to pass
> through XMLRPC. I've tried converting the tuples from the adbapi output
> to strings before handing back but that has other issues.
> 
> Is this a limitation of XMLRPC that would merit using an approach like
> PB instead? Eventually my text client will go the way of a Qt GUI and I
> thought XMLRPC would make a nice lightweight distributed interface, but
> the serialization issues are making me wonder if the approach is right.

I also send adbapi results over xml-rpc, using strftime to convert
the mxDateTimes to an ISO string format and then converting them
back to mx.DateTimes with DateTime.ISO.ParseDateTime.  Not elegant,
but it does the job.  Note that PB's jelly will also complain about
DateTimes.

Steve





More information about the Twisted-Python mailing list