-
for a descriptor you would want something like this:
http://pastebin.de/pastebin.py?id=1276
-
Ahh... I knew there was another way to do it. Thanks Bob.
-
Well, I do this kind of thing all the time at work in a custom python container that I helped write. Using metaclasses, I wrote a simple, but powerful aspect-oriented framework. Using this, I can simply tag a certain class, or certain methods of a class, to have their methods wrapped inside a transaction. I can also automatically do rollbacks "on exception" using aspects.
Very powerful, and also quite easy.