How do I add a decorator to a method in python?
- by Timmy
How do I add a decorator to a method in a class? I tried
def add_decorator( cls ):
@dec
def update(self):
pass
cls.update = update
@dec did not apply to update
I'm trying to use this with orm.reconstructor in sqlalchemy.