On Dec 11, 2008, at 9:43 AM, Max Ischenko wrote:
>
> Hello,
>
> I'm migrating my pylons app to SA 0.5 I ran into strange behaviour.
>
> I found that hen creating new object it ends up in Session
> automatically. Why is that?
>
> After some debugging I found this:
>
> def init_instance(self, mapper, class_, oldinit, instance, args,
> kwargs):
> if self.save_on_init:
> session = kwargs.pop('_sa_session', None)
> if session is None:
> session = self.context.registry()
> session._save_without_cascade(instance)
> return EXT_CONTINUE
>
> Obviously this is international. But why? It doesn't make sense and
> 05Migration do not mention this.
>
> After I added
> Session.extension = Session.extension.configure(save_on_init=False)
>
> the code started working again.
>
> Do I miss something or this is a bug?
Are you using Session.mapper ? That's the same behavior the
extension had in 0.4, save-on-init. I don't favor the usage of
Session.mapper.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---