Hi
I think I have a solution how to list all expose method and also return
documentation. I suggest that @doc be introduce to web2py so we can have a
dynamic documentation of all exposed method for services consumers. What do
you think ?
def makeRegistrer():
registry = {}
def registrer(func):
registry[func.__name__] = func.__doc__
return func # normally a decorator returns a wrapped function,
# but here we return func unmodified, after
registering it
registrer.all = registry
return registrer
doc=makeRegistrer()
def index():
return dict(msg= BEAUTIFY(reg.all))
@service.json
@doc
def echo(data):
""" echo test """
return data
Den måndagen den 25:e februari 2013 kl. 10:40:01 UTC+1 skrev frasse:
>
> Hi
> I like to have a method to returns a list of all exposed methods in a
> controller so it can be use in a view. I want to build a information
> webpage for service consumers (xmlRpc , Json .....) that can be updated
> when I add /update/ remove new service to my application API. Can web2py do
> it for me ?
>
> Thanks
> /F
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.