mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 23:10:17 +00:00
Support for pickling/unpickling Row objects. Makes Datasets pickleable.
This commit is contained in:
@@ -51,6 +51,19 @@ class Row(object):
|
||||
def __delitem__(self, i):
|
||||
del self._row[i]
|
||||
|
||||
def __getstate__(self):
|
||||
|
||||
result = dict()
|
||||
result["_row"] = self._row
|
||||
result["tags"] = self.tags
|
||||
|
||||
return result
|
||||
|
||||
def __setstate__(self, state):
|
||||
|
||||
self._row = state["_row"]
|
||||
self.tags = state["tags"]
|
||||
|
||||
def append(self, value):
|
||||
self._row.append(value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user