correction. auth decorators do work
On Mar 8, 12:31 pm, mdipierro <[email protected]> wrote:
> On Mar 8, 11:46 am, Fran <[email protected]> wrote:
>
>
>
> > 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?
>
> No but it allows you to define a function once and expose any multiple
> services.
>
> > This doesn't handle JSON upload at all does it?
>
> I think it does. Can you provide an example of what you mean?
>
> > > @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?
>
> Yes can can use auth, but they cannot use auth decorators (I can make
> it so).
>
> > Anyone able to provide a way of testing this out at all?
>
> I will rewrite the pyjamas examples to use this as soon as we ship
> 1.58.
>
> Massimo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---