On Aug 21, 2008, at 10:45 AM, Michael Bayer wrote:
> > > On Aug 21, 2008, at 7:02 AM, naktinis wrote: > >> >> Ok, so the problem might be because the first test fails while doing >> Session.clear(): >> >> Traceback (most recent call last): >> File ".../tests/__init__.py", line 35, in tearDown >> Session.clear() >> File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/ >> sqlalchemy/orm/scoping.py", line 98, in do >> return getattr(self.registry(), name)(*args, **kwargs) >> File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/ >> sqlalchemy/orm/session.py", line 668, in clear >> self._unattach(instance) >> File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/ >> sqlalchemy/orm/session.py", line 1141, in _unattach >> if instance._sa_session_id == self.hash_key: >> AttributeError: 'User' object has no attribute '_sa_session_id' >> >> The background for this situation is in the first post of this >> thread: >> create_instance simply returns User() object. However, if instead of >> that I return EXT_CONTINUE - everything works fine. So maybe there's >> something missing in my create_instance definition? > > There should be nothing needed within the create_instance() > definition, and _sa_session_id is set on all instances unconditionally > within create_instance(). You'll have to provide a complete example > of usage here. correction, I meant to say, _sa_session_id is set unconditionally within Mapper._instance(), after create_instance() has been called if at all. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---