I am pickling Python Objects in Django and saving it in MySQL db. So far i have followed these simple rules:
cPickle.dumps(object)#to convert python object to pickled objectcPickle.loads(pickled_object)# to load back the python object from pickled objectMy Django
Model FieldisText FieldMySQL db field Type is
longblobAttributesbinaryMySQL db encoding is
utf8_unicode_ci
Unfortunately i am getting following error while loading back python object.
Type Error: ('an integer is required', <type 'datetime.date'>, ('x07xb6x0bx06',))
It seems to me by looking on error value x07xb6x0bx06 this is an encoding problem.
Did i miss some important step?? Can any one help me to solve this problem??
json.dumpsbut got this errorsome_object is not JSON serializable. And the object is pure Pythonic.