On Jan 10, 2008, at 6:51 AM, Laurent Houdard wrote:

>
>> if youd like to check for this condition after each flush you can do
>> it with SessionExtension, using after_flush().   it could be done  
>> in a
>> single DELETE statement, i.e.
>>
>> delete from keywords where not exists(select 1 from
>> keyword_associations where keyword_id=keywords.id)
>
> ...But I would also like to track tag deletion in SessionExtension,
> and If I'm using directly a DELETE statement, it won't trigger
> anything in SessionExtension.

A statement issued in SessionExtension would fire unconditionally upon  
any flush(), so thats the trigger there.   not sure what you mean by  
"track" here, if it means you want to know the keywords that were  
deleted, you'd just issue the above SELECT first, do something with  
the rows, then the DELETE.

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