diff options
| author | Luca Beltrame <luca.beltrame@marionegri.it> | 2011-05-12 16:04:46 +0200 |
|---|---|---|
| committer | Luca Beltrame <luca.beltrame@marionegri.it> | 2011-05-12 16:04:46 +0200 |
| commit | 35f21cf73ea19a1c1a1a9fc5ed35de2b23d0a0b3 (patch) | |
| tree | 18b63fc422d6fd0672ce14a309f7f197cf5af9c2 | |
| parent | 0ebc8f5e1b4fff9822128314b48911b95b9a0e28 (diff) | |
| download | tablib-35f21cf73ea19a1c1a1a9fc5ed35de2b23d0a0b3.tar.gz | |
Fix pickling/unpickling of Dataset instances.
| -rw-r--r-- | tablib/core25.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tablib/core25.py b/tablib/core25.py index c8352a6..800cae3 100644 --- a/tablib/core25.py +++ b/tablib/core25.py @@ -35,7 +35,7 @@ __docformat__ = u'restructuredtext' class Row(object): u"""Internal Row object. Mainly used for filtering.""" - __slots__ = [u'tuple', u'_row', u'tags'] + __slots__ = [ u'_row', u'tags'] def __init__(self, row=list(), tags=list()): self._row = list(row) @@ -63,7 +63,14 @@ class Row(object): del self._row[i] def __getstate__(self): - return {slot: [getattr(self, slot) for slot in self.__slots__]} + + slots = dict() + + for slot in self.__slots__: + attribute = getattr(self, slot) + slots[slot] = attribute + + return slots def __setstate__(self, state): for (k, v) in list(state.items()): setattr(self, k, v) |
