fixed serialization of Storage objects

This commit is contained in:
mdipierro committed 2014-09-08 08:10:58 -05:00
1 parent bb3909a944
commit 94aab906d5
3 files changed
+10 -2

No files matched your search

+7
View File
@@ -13,6 +13,7 @@ Provides:
"""
import cPickle
import copy_reg
import gluon.portalocker as portalocker
__all__ = ['List', 'Storage', 'Settings', 'Messages',
@@ -129,6 +130,12 @@ class Storage(dict):
values = self.getlist(key)
return values[-1] if values else default
def pickle_storage(s):
return Storage, (dict(s),)
copy_reg.pickle(Storage, pickle_storage)
PICKABLE = (str, int, long, float, bool, list, dict, tuple, set)