So I tried it out, and it works great, except for one thing - when I try to use record.as_dict() to get
the structure which I can return to a JSON-RPC call which I normally use to communicate with my
client, it simply does not return the field.
I tried to print it out and I see very clearly that as long as it is a Row object there is no problem, but
as soon as I run .as_dict() it disappears.
My definitions are as follows:
from gluon.dal import SQLCustomType
pickled = SQLCustomType(
type = 'text',
native = 'text',
encoder = (lambda x: pickle.dumps(x)),
decoder = (lambda x: pickle.loads(x))
)
then I use
db.define_table("my_table",
Field("pickled_field", type=pickled)
)
but when I fetch the record it does not go to as_dict() (actually I use as_list() but both don't work).
Any suggestions? Is there a way to teach as_dict to interpret this field type?
Best wishes,
Omri