you probably dont want to save() the object to the session until its in a decent state.
Note that the usage of Session.mapper, which is going to "autosave" new objects to the session, is not recommended, since you cant control when an object gets saved. I'm pretty sure this has been taken off the pylons tutorials and such. On Sep 1, 2007, at 5:53 PM, Haseeb wrote: > > I'm using 0.4b4's scoped_session + sessionmaker with autoflush=True. > Is there a way to prevent autoflushing an object when a query is run > on an unrelated table? I have a partially constructed object and I > need to execute queries on other tables to populate certain fields on > the object. These queries end up trying to flush my partially > constructed object which results in 'IntegrityError's because certain > fields are not yet populated. I can change the ordering in which > fields are populated but is there a better way to manage when an > object is fully constructed and ready to be autoflushed? > > Thanks. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
