On Mar 8, 3:48 pm, mdipierro <[email protected]> wrote:
> In the example you are exposing a function
> def f(a,b): return a+b
> which sums a and b. There is nothing special about a and b.
> You can expose any function with takes any parameters you like.

ok

So this should probably go in the model:
from gluon.tools import Service
service=Service(globals())

> Once you create a function you just decorate it with
> @service.json
> if you want to reurn its value as json, or with

Currently easy enough to download data as JSON using the .json()
syntax, e.g.:
item=db(table.id==t2.id).select(table.ALL).json()
return dict(item=item)

Does this do anything else?

This doesn't handle JSON upload at all does it?

> @service.jsonrpc
> if you want to be able to call it via json rpc. etc etc.

ok, so being able to easily expose controller functions to JSONRPC or
XMLRPC sounds *great*
Can these use the integrated Auth?
Anyone able to provide a way of testing this out at all?

Thanks,
F
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to