equal
deleted
inserted
replaced
12 '''validate decorator |
12 '''validate decorator |
13 use it like this: |
13 use it like this: |
14 @validate(userhash=vuserhash) |
14 @validate(userhash=vuserhash) |
15 f(userhash) |
15 f(userhash) |
16 that will validate usrhah with the function vuserhash. |
16 that will validate usrhah with the function vuserhash. |
17 Every validate function should raise an Exception, if the the value is not valide''' |
17 Every validate function should raise an Exception, if the the value is not valid''' |
18 def v(f): |
18 def v(f): |
19 def new_f(*a,**k): |
19 def new_f(*a,**k): |
20 kp=getcallargs(f,*a,**k) |
20 kp=getcallargs(f,*a,**k) |
21 for i in kargs: |
21 for i in kargs: |
22 kargs[i](kp[i]) |
22 kargs[i](kp[i]) |