rset.py
branchstable
changeset 5740 46207f491a51
parent 5671 3a2063b752f3
child 5747 d6ac0cd30fde
--- a/rset.py	Fri Jun 11 15:54:29 2010 +0200
+++ b/rset.py	Fri Jun 11 18:47:53 2010 +0200
@@ -44,6 +44,9 @@
     :type rql: str or unicode
     :param rql: the original RQL query string
     """
+    _picklable_attributes = set(['limited', 'rows', 'description', '_rsetactions',
+                                 'args', 'rowcount', '_rqlst', 'rql'])
+
     def __init__(self, results, rql, args=None, description=(), rqlst=None):
         self.rows = results
         self.rowcount = results and len(results) or 0
@@ -117,6 +120,10 @@
         """Returns an iterator over rows"""
         return iter(self.rows)
 
+    def __getstate__(self):
+        return dict((k, v) for k, v in self.__dict__.iteritems()
+                    if k in self._picklable_attributes)
+
     def __add__(self, rset):
         # XXX buggy implementation (.rql and .args attributes at least much
         # probably differ)