Implement each() convenience method
This commit is contained in:
parent
ca2c0c9ce8
commit
277c4c0aab
1 changed files with 9 additions and 0 deletions
|
@ -43,6 +43,15 @@ class DatabaseTableCursor():
|
|||
def fetchall(self):
|
||||
return map(self.__map__, self.cr.fetchall())
|
||||
|
||||
def each(self):
|
||||
while True:
|
||||
obj = self.fetchone()
|
||||
|
||||
if obj is None:
|
||||
break
|
||||
|
||||
yield obj
|
||||
|
||||
class Database():
|
||||
__slots__ = 'db',
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue