dtuple and sql functions

tweek tweek154 at yahoo.com
Wed Dec 26 14:30:33 EST 2001


i am dealing with converting the date format from a MySQL database and
i'd prefer to use the built in sql function than convert it using
python.  here is what im trying to accomplish:


flist = ["AssignedTo", "DATE_FORMAT(DueDate, '%m/%e/%Y')"]
descr = dtuple.TupleDescriptor([[n] for n in flist])

sql = """SELECT %s FROM joblog""" % ", ".join(flist)
c.execute(sql)
temp = c.fetchall()


now unfortunately the field name is now called:
temp.DATE_FORMAT(DueDate, '%m/%e/%Y')

which should be invalid anyways.  what i want is to use it as
temp.DueDate


Tweek



More information about the Python-list mailing list