> user_data = web.ctx.db.select(...) #your query > first = next(iter(user_data), None) > print(first) > > iter(user_data) produces an iterator over the result set, next() then fetches > the next (in this case the first) element of it.
I thought webpy creates an iterator on db queries by default? That is why one has to use .list() to load everything into memory. Or am I misunderstanding what you are trying to explain? Bests, Dragan -- You received this message because you are subscribed to the Google Groups "web.py" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/webpy. For more options, visit https://groups.google.com/groups/opt_out.
