On Mon, Mar 17, 2008 at 12:39:41PM +0000, Nick Murdoch wrote:
> Surely doing that would be no more efficient (aside from going through
> SQLObject's interface) than making multiple calls to select() yourself?

   Sure.

> Writing a generator function to do that should be reasonably easy, though.

   BTW, SelectResults (i.e., the result of calling .select()) has
.lazyIter() method that returns an iterator that inside its .next() method
calls cursor.fetchone() instead of .fetchall(). So you can try

for row in MyTable.select(condition).lazyIter():
   process(row)

   Hope it helps.

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