I recently defined a pickled SQLCustomType field for automatic dumping/loading of inserted types to the field.
The definition is:
pickled = SQLCustomType(
type = 'text',
native = 'text',
encoder = (lambda x: pickle.dumps(x)),
decoder = (lambda x: pickle.loads(x))
)
I use it to store a dictionary of values, which I later retrieve and send to the client via an jsonrpc service. For this
to work, I need to call the as_dict() method of the Row object I obtained from the database.
The problem is that "dict" is not recognized as a serializable by the as_dict method.
Is it safe to simply add it to the list of values already defined there? Is there a different way of letting the Row object
know how to decode the value? Is there a way to do it so that next time when I update web2py it will stay defined?
Thanks!
Omri