[web2py] session.forget() on GAE

2010-03-10 Thread chris p
I have a small app running on the google app engine, with some controllers called from crons. Each time this happens, a session object gets stored for the call, which in my app is unnecessary. I have added a call to session.forget() (actually I just uncommented the one already in the default mode

[web2py] Re: session.forget() on GAE

2010-03-11 Thread chris p
e session record. It cannot delete the session > automatically because the session bay have been created by another > request and contain data used by another request. You must delete it > yourself it you know it is safe. > > On Mar 10, 10:03 am, chris p wrote: > > > > > I

[web2py:37402] Re: pyjamas for javascript in web2py

2009-12-16 Thread chris p
Can you be more specific with your question? It sounds like you are asking to execute a pyjamas functions from the controller. Controllers can't call functions defined in pyjamas, only respond to calls from them... you need to define functions in your controllers that are exposed as json services,

[web2py:16024] Re: Pyjamas and web2py

2009-02-08 Thread chris p
I got this working today, and it seems fine with the Pyjamas "JSONRPCExample" from the pyjamas distribution. Here's the code (originally based on some of the samples above, with several fixes and some error handling added). I changed the pyjamas object to 'jsonrpc' instead, since this is a generi

[web2py:16025] Re: Pyjamas and web2py

2009-02-08 Thread chris p
I'm reposting as my first didn't seem to go through I got this working with the pyjamas JSONRPCExample. Most of the changes were in the jsonrpc server examples posted above. Here's the code controllers/rpc.py -- # try something like def index(): retu

[web2py:16045] Re: Pyjamas and web2py

2009-02-08 Thread chris p
Massimo, Your AlterEgo post is probably the best place to maintain the example until you put it into the web2py distribution. Please take a look at my code above however, as it handles errors according to the JSONRPC spec. In particular, errors are not just a string in the 'error' element of the

[web2py:16046] Re: Pyjamas and web2py

2009-02-08 Thread chris p
> On Feb 8, 11:35 am, chris p wrote: > > > I'm reposting as my first didn't seem to go through > > > I got this working with the pyjamas JSONRPCExample.  Most of the > > changes were in the jsonrpc server examples posted above. Here&#x

[web2py:16074] Re: Pyjamas and web2py

2009-02-09 Thread chris p
gt; > Massimo > > On Feb 8, 6:04 pm, chris p wrote: > > > Here's the reference I was using for the error return > > protocol:http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html > > > On Feb 8, 1:24 pm, mdipierro wrote: > > > > Thank you ch

[web2py:16075] Re: Pyjamas and web2py

2009-02-09 Thread chris p
Here's what I ended up with on the server side (in web2py, it goes in models/jsonrpc.py): - import gluon.contrib.simplejson as simplejson import types class JSONRPCService: def response(self, id, result): return simplejson.dumps({'version': '1.1', 'id':id,

[web2py:17059] Re: Critical point in web2py

2009-02-27 Thread chris p
I've been mostly lurking, but would like to offer a few comments... reST to HTML is very straightforward, the docutils pacage has an rst2Html script to do exactly that (and it is just a few lines of code). Sphinx, as Yarko has pointed out, is a tool chain using reST that adds better facilities f