From: Chris L. <chr...@sp...> - 2007-01-31 20:40:35
|
I'm trying to find a flexible way of storing visual objects in a database. I had considered building a set of schema's to describe the objects but a desire to store other parameters along with the visual objects made me feel that might not be as maintainable as I might like so I thought of pickling visual objects and saving the serialized output. Upon trying this I get: Traceback (most recent call last): File "<pyshell#36>", line 1, in <module> pickle.dump(data, output) File "C:\Python25\lib\pickle.py", line 1362, in dump Pickler(file, protocol).dump(obj) File "C:\Python25\lib\pickle.py", line 224, in dump self.save(obj) File "C:\Python25\lib\pickle.py", line 286, in save f(self, obj) # Call unbound method with explicit self File "C:\Python25\lib\pickle.py", line 562, in save_tuple save(element) File "C:\Python25\lib\pickle.py", line 331, in save self.save_reduce(obj=obj, *rv) File "C:\Python25\lib\pickle.py", line 401, in save_reduce save(args) File "C:\Python25\lib\pickle.py", line 286, in save f(self, obj) # Call unbound method with explicit self File "C:\Python25\lib\pickle.py", line 562, in save_tuple save(element) File "C:\Python25\lib\pickle.py", line 295, in save self.save_global(obj) File "C:\Python25\lib\pickle.py", line 748, in save_global (obj, module, name)) PicklingError: Can't pickle <type 'Boost.Python.instance'>: it's not found as Boost.Python.instance >>> Is this a non starter or might it be worthwhile to strip out the parameters of a visual object and repopulate the object upon pickle.load()? |