Hello,
I'm following the steps given on AlterEgo to define fancy decorators.
(http://mdp.cti.depaul.edu/AlterEgo/default/show/204). I'm only
exposing procedures through run and am getting a TypeError.
Here's the code in my model:
from gluon.storage import Storage
settings=Storage()
settings.exposed_procedures=[]
def expose(f):
settings.exposed_procedures.append(f.__name__)
return f
And the code in my controller:
def run():
if request.args and request.args[0] in
settings.exposed_procedures:
return eval('%s(*request.args[1:],**dict
(request.vars))'%request.args[0])
return 'Not Authorized'
@run
def create(name):
print name
I appreciate any feedback on this typeerror. Also, can I assume this
should work the same way service decorators do? Is there any
advantage?
Thanks,
Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---