Re: [SQLObject] bug with python24 and fromDatabase=True
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: sophana <so...@zi...> - 2006-04-05 12:35:20
|
Oleg Broytmann wrote: >(Reply to the list, please) > >On Wed, Apr 05, 2006 at 09:54:53AM +0200, sophana wrote: > > >>in my previous mail, you can see that the whole colData elements are >>array instead of strings. >> >>/usr/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/mysql/mysqlconnection.py(130)columnsFromSchema() >> >>-> colClass, kw = self.guessClass(t) >>(Pdb) l >>125 % tableName) >>126 results = [] >>127 for field, t, nullAllowed, key, default, extra in colData: >> >> > > > >>(Pdb) print colData >>((array('c', 'id'), array('c', 'int(11) unsigned'), array('c'), >>array('c', 'PRI'), None, array('c', 'auto_increment')), (array('c', >>'UserName'), array('c', 'varchar(64)'), array('c'), array('c', 'MUL'), >>array('c'), array('c')), (array('c', 'Attribute'), array('c', >>'varchar(32)'), array('c'), array('c'), array('c'), array('c')), >>(array('c', 'op'), array('c', 'char(2)'), array('c'), array('c'), >>array('c', '=='), array('c')), (array('c', 'Value'), array('c', >>'varchar(253)'), array('c'), array('c'), array('c'), array('c'))) >> >> > > A big tuple of arrays. "for" loop will assign an array for its every >varaible including 't'. Right? > >Oleg. > > briefly looking at the code, it seems that all these arrays should have been strings. colData comes from a self.queryAll call which is handled in the dbconnection.py. colData = self.queryAll("SHOW COLUMNS FROM %s" % tableName) itself call cursor.fetchall() to get all these arrays. As I don't know what it is, I didn't go farther. Note: my other sqlobjects without fromDatabase=true work fine. |