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

Stephen Waterbury golux at comcast.net
Wed May 12 19:31:04 MDT 2004


Federico Di Gregorio wrote:
> Lì mercoledì, 2004/05/12 alle 16:30, -0400, Stephen Waterbury ha
> scritto:
> 
>>>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
> 
> why don't you people switch to psycopg nd register a custom type
> converter using new_type/register_type? you can easily nd automagically
> convert dates and times to strings with a 3-lines callable object.

Mine is part of a general type converter that I have (cook()/uncook())
that handles all types I need to serialize.  psycopg might make the 
implementation of my cook/uncook functions slightly more concise, but
right now they are independent of the specific dbapi that I use, so I
might want to keep it that way (more componentized ;).

- Steve





More information about the Twisted-Python mailing list