On Nov 2, 2008, at 10:54 AM, Lukasz wrote:

>
> Hi,
>
> Is there a possibility to retrieve only objects that have been
> actually modified after commit? If I retrieve session.dirty before
> commit I see more objects ready to be modified than I changed (those
> extra objects are the foreign keys of the modified one). Also the
> number of queries that are sent to DB is less than dirty objects. Is
> there a way to retrieve only the objects that the queries were issued
> for?


call session.is_modified(instance) on each member you get back from  
session.dirty.

Within the flush process, further "dirty" flags may be set due to  
foreign key attributes that are set.   The only way to reliably  
anticipate these before they happen would be within the  
before_insert() or before_update() mapper extension methods, and you'd  
again use session.is_modified() as the authority on this.

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

Reply via email to