[sqlalchemy] Re: PickleType with custom pickler

2006-12-08 Thread dmiller
On Dec 8, 2006, at 1:30 PM, Michael Bayer wrote: the reason that get_history calls attribute_manager.get_history is because all awareness of attribute history is handled by the attribute module. the reason attribute_manager then calls the InstrumentedAttribute off of the class is because

[sqlalchemy] Re: PickleType with custom pickler

2006-12-08 Thread Michael Bayer
while youre free to make your own InstrumentedAttribute, i think that is a long uphill battle which also might be incompatible with new releases. I think you might want to go with sticking some hidden attributes on your pickleable object so that your custom PickleType can just use those to

[sqlalchemy] Re: PickleType with custom pickler

2006-12-08 Thread Michael Bayer
this is a simple example of what youre trying to do. its not even as fancy as what i described above and just uses a threadlocal to keep track of the current Session: from sqlalchemy import * from sqlalchemy.orm.session import object_session from cStringIO import StringIO from pickle import