On Sunday, 17 February 2013 22:54:30 UTC-8, cguardia wrote:

> Hi, 
>
> there were some problems with the code snippets in the book. I updated 
> them here: 
>
> http://zodb.readthedocs.org/en/latest/transactions.html#before-commit-hooks 
>
> For some reason I could only get synch to work using classmethod. 
>
>
Pass an instance of the MySynch class rather than the class itself, e.g:

class MySynch(object):
    def beforeCompletion(self, transaction):
        print "Commit started"

    def afterCompletion(self, transaction):
        print "Commit finished"
import transactionsynch = MySynch()transaction.manager.registerSynch(synch)

Laurence

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-devel+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to