Just to clarify things :

JSONRPC!=JSON

jsonrpc is a json specialization used as protocol to call remote
procedures.  web2py can be used to publish *jsonrpc* services using
@service.jsonrpc

mic
Il giorno 02/apr/2012 16:33, "Carl Roach" <m...@carlroach.com> ha scritto:

> yes... I've been using @service.json and my Pyjamas app can call such
> decorated and retrieve json-formatted data. all I need to do is "return
> {'tag1', data1', 'tag2', data2}
>
> I now want to know how I can get a GWT app to call the same function.
> Anyone using GWT with Web2py?
>
>
> On 2 April 2012 11:34, Michele Comitini <michele.comit...@gmail.com>wrote:
>
>> Carl,
>>
>> You may find the @service.json annotation useful.
>> Try the following:
>>  return dict(prices=prices)
>>
>> Il 02 aprile 2012 11:08, Carl <m...@carlroach.com> ha scritto:
>> > I'm looking at the example StockWatcher.java from GWT modified to use
>> JSON
>> > and call a Web2py server app.
>> >
>> > In the client app I'm
>> > using: http://127.0.0.1:8000/init/default/stockPrices.json?q=ABC
>> > note the ".json" extension.
>> >
>> > In my default.py in Web2py I have:
>> > def stockPrices():
>> >     sym = request.vars['q']
>> >     rows = db(db.stock_price).select()
>> >     prices = rows.find(lambda row: row.symbol in sym).as_list()
>> >     return json.dumps(prices)
>> >
>> > Is there an approach in Web2py I can use that I don't need to call
>> > json.dumps() when returning "prices" ? What are others doing?
>>
>
>

Reply via email to