I have class:
@custom_decorator
class Creature(objects):
def __init__(self):
pass
def rise_hands(self, *args, **kwargs):
print 'hands rised'
I want to define the custom decorator on the top of this class Creature, so that it will redefine the method rise_hands or adds new methods.
By the way: how can I redefine the values of args or kwargs?
UPDATE:
The gola is as follow:
I wanna implement an app with decorator for django models. Whatever i define it on the model it will log changes by saving old values and new values of curten fields…
Don’t. Do. This.
You have inheritance to do exactly what you’re talking about.
This is the way you “redefine the method
rise_handsor adds new methods”