On Jan 11, 2009, at 4:51 PM, Werner F. Bruhin wrote:
> > I can not find the answer looking through the 0.5 doc for my problem. > > query = > session.query(db.SomeClass).filter(something).order_by(anorder) > > # get the first row > row = query.first() > > # display a dialog to the user > # one of the possible actions is to press a button which should show > the > next row in the query > row = query.???() > > How could I use "fetchone()" on this? Or is there another/correcter > way > to do this type of thing ins SA? the query itself is an iterator, so you could say result = iter(query); row = result.next() . now, if you are looking for the results from the *server* to be non- buffered, that requires something more (namely yield_per()), but it has a lot of caveats so I would not use it unless you absolutely know what you're doing. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---