rset.py
branchstable
changeset 6857 8d2062387134
parent 6225 a176e68b7d0d
child 6859 ace0b991e17b
--- a/rset.py	Thu Jan 20 09:16:52 2011 +0100
+++ b/rset.py	Wed Jan 19 19:19:56 2011 +0100
@@ -386,6 +386,19 @@
             if self.rows[i][col] is not None:
                 yield self.get_entity(i, col)
 
+    def iter_rows_with_entities(self):
+        """ iterates over rows, and for each row
+        eids are converted to plain entities
+        """
+        for i, row in enumerate(self):
+            _row = []
+            for j, col in enumerate(row):
+                try:
+                    _row.append(self.get_entity(i, j) if col is not None else col)
+                except NotAnEntity:
+                    _row.append(col)
+            yield _row
+
     def complete_entity(self, row, col=0, skip_bytes=True):
         """short cut to get an completed entity instance for a particular
         row (all instance's attributes have been fetched)