[Twisted-Python] Re: Insecure Jelly exception in daemon mode (John Toohey)

Turn the data into nice types, with pg you might get PgInt types from your data, and each row of the database is in a special list & dict type allowing numeric or nomical access the value of each column. Easy way: tosend = [] for row in data: newRow = tuple([str(item) for item in row]) tosend.append(newRow) Better way? Surposing your data is returned as an int, a date/time, an interval (mx.datetimedelta) and a string... tosend = [] for myint, mydate, mydelta, mystr in data: tosend.append((int(myint), packageDate(mydate), packageDateTimeDelta(mydelta), str(mystr))) def packageDate(d): return d.year, d.month, d.day, d.hour, d.minute, d.second def unpackageDate(d): from mx.DateTime import DateTime return DateTime(*d) I will leave the rest as an exercise for the reader. See *http://twisted.sourceforge.net/TwistedDocs-1.2.1alpha1/howto/pb-copyable.htm... May God bless you and your family Matthew Sherborne www.sherborneinternational.com *
participants (1)
-
Matthew Sherborne