[sqlalchemy] pickling errors

2010-02-13 Thread avdd
I'm getting some strange errors with unpickling. I've tried all combinations of pickle/cPickle and protocol in (0,1,2) and still getting this apparent random error: sqlalchemy.orm.collections:622 __setstate__ self.attr = getattr(d['owner_state'].obj().__class__, d['key']).impl

Re: [sqlalchemy] pickling errors

2010-02-13 Thread Michael Bayer
On Feb 13, 2010, at 11:03 AM, avdd wrote: I'm getting some strange errors with unpickling. I've tried all combinations of pickle/cPickle and protocol in (0,1,2) and still getting this apparent random error: sqlalchemy.orm.collections:622 __setstate__ self.attr =

[sqlalchemy] Re: Reflected Tables and Session [and how to bind]

2010-02-13 Thread David Bolen
Rob robert.sudwa...@googlemail.com writes: However, importing [or trying to instantiate this class] will fail until the connection is in place ie the class as it stands cannot be called until a valid engine is bound. I'm guessing that something will need to be passed to an __init__ in the

[sqlalchemy] Zope scoped session autoflush seems to not function properly

2010-02-13 Thread Kent
I'm using sqla 0.5.8 with turbogears, which uses zope (I admit ignorance to what zope does, sorry) When I try to turn autoflush off because I want to make numerous changes and require queries in the meantime, the flush happens anyway when I attempt to query. Over-simplified example demonstrating

Re: [sqlalchemy] Zope scoped session autoflush seems to not function properly

2010-02-13 Thread Michael Bayer
On Feb 13, 2010, at 7:05 PM, Kent wrote: # want to do more queries and change more, so set autoflush to False DBSession.autoflush = False yeah sorry here, autoflush isn't propagated in 0.5.8 to the actual session when using scoped_session(). That was fixed in 0.6. Here you'd say

[sqlalchemy] Re: Zope scoped session autoflush seems to not function properly

2010-02-13 Thread Kent
Forgive the lack of understanding... still learning the framework: It seems to me that will set the value on the class instead of the instance?? If this is on a webserver with multiple connections, will that affect any other connections for the period that it is set to false? On Feb 13, 8:39 

Re: [sqlalchemy] Re: Zope scoped session autoflush seems to not function properly

2010-02-13 Thread Michael Bayer
On Feb 13, 2010, at 9:24 PM, Kent wrote: Forgive the lack of understanding... still learning the framework: It seems to me that will set the value on the class instead of the instance?? scoped_session returns an object that is a proxy to an actual session. the methods you call upon it