On Jul 17, 2011, at 5:13 AM, Chris Withers wrote:

> On 17/07/2011 10:12, Wichert Akkerman wrote:
>> On 2011-7-17 11:07, Chris Withers wrote:
>>> On 30/06/2011 09:30, Wichert Akkerman wrote:
>>>> On 06/30/2011 10:14 AM, Chris Withers wrote:
>>>>> - Specify sqlalchemy 0.6 as a requirement, until
>>>>> zope.sqlalchemy is ported, mortar_rdb shouldn't be
>>>>> used with :mod:`sqlalchemy` 0.7.
>>>> 
>>>> What is missing? zope.sqlalchemy seems to work fine with sqlalchemy 0.7
>>>> as far as I've seen.
>>> 
>>> It uses an old-fashioned SessionExtension, it needs to be ported over to
>>> the new events stuff that arrived in 0.7.
>> 
>> That might be a nice change, but the 'old-fashioned SessionExtension'
>> still works, so I see no reason not to use it.
> 
> Michael,
> 
> Is there a migration guide for moving from SessionExtension to the new events 
> stuff anyway? (with example for the feeble of mind, like me ;-) )

migration guide....  well we're talking about callables either attached to an 
Extension class, or, just wherever.

So its....  1. delete the line with "SessionExtension"/"MapperExtension"/etc.   
2. dedent all the methods below it to module level callables  3. remove the 
"self," from all the callables 4. apply the event.listens_for decorator and/or 
event.listen function to the desired target(s).  5. remove the usage of the 
"extension" keyword from the Session/Mapper/attribute/engine/etc.

Or, replace 1., 2. and 3. with 1. instantiate the 
SessionExtension/MapperExtension/ etc. whatever, then just use event.listen() 
with each of the attributes.

Easy !

-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to