On Thu, Feb 28, 2008 at 02:57:50AM -0200, Sam's Lists wrote:
> I can print the record find by coercing it into a string.
> 
> But I'd like to be able to iterate through it myself.  And I can't.  I keep
> getting:  'TypeError: 'TheRun' object is not iterable'
> 
> Why is this the case?

   Why do you expect a record to be iterable? There is a list of column
names, but there is no a list of values, you have to get a value for
a column by the column's name.
   I don't see any meaning in the code

for value in my_row:...

   because during the loop you don't know column name and type for the
value.
   You can iterate through the list of columns:

for column in row.sqlmeta.columnList:
   print getattr(row, column.name)

but remember there is also a list of joins (sqlmeta.joins) and indices.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to