On 9/1/07, Haseeb <[EMAIL PROTECTED]> wrote:
> You're right - I am using Session.mapper which I took off the pylons
> tutorials. I'm mainly using Session.mapper to get the old assignmapper
> functionality of the 0.3x tree. Is there a way to get assignmapper
> functionality in 0.4x without losing the ability to control when an
> object gets added to the session?

It's a matter of thinking the opposite.  Because new objects are
automatically saved, you don't have to .save them to get them into he
database.  Instead you have to .expunge() the ones you *don't* want
saved in the database, and do that early enough that it doesn't get
written.

I agree that the autosaving is the most confusing part of
Session.mapper, and the interface should require it to be explicitly
enabled:
    Session.mapper(A, B, autosave=True)

Both assign_mapper and Session.mapper have the assumption that "of
course everybody wants autosave", but that's not true.  Some want the
.query attribute, some want autosaving, and some want both.  At least
the .query attribute you can ignore if you don't want it, but there's
no way to disable autosaving.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to