Re: Pylons on GAE

2010-07-02 Thread Shailesh Kochhar
I would suggest taking the parts you want most and adding them to the app engine environment. The differences and limitations of app engine make packages like sqlalchemy and beaker less effective. I bundled routes, the paste packages and pylons (and nose!) then stitched them together with the go

Re: trying to figure out the exact changes in the controlers and views for 1.0

2010-06-01 Thread Shailesh Kochhar
I had to figure this out too and it keeps coming up as a question. The short answer is: 1. In controllers, add: "from pylons import url" and then use url(). You can add this to a central place and use it in all your controllers. 2. In templates, just use url(), it's available and works. Hope

Re: How do you signal the end of streaming content?

2010-04-21 Thread Shailesh Kochhar
On 04/21/2010 01:12 PM, Mike Orr wrote: On Wed, Apr 21, 2010 at 8:57 AM, Paweł Stradomski wrote: 2010/4/21 jazg: Why would it prevent future requests if each request is a new thread? I could manually create another thread for the job, but it seems like that should not be necessary. I still d

background threads, multi-cores and jython

2010-02-12 Thread Shailesh Kochhar
Hi, I have an app with a few background threads doing housekeeping tasks, periodically updating stats etc. The way I have it setup is in Globals, I create instances of my thread-classes, start them and save a handle. This makes it possible for me to have controller methods which can query the

Re: Returning 405 status from route matching

2009-12-15 Thread Shailesh Kochhar
Mike, I do something like this in my controllers: import pylons.decorators.rest as rest from app.lib.errors import MethodNotAllowedError class QuestionController(BaseController): @rest.dispatch_on(GET='get_questions', POST='add_questions') def questions(self, id): raise Metho

Adding keys to request.params [was: Re: Calling a controllers method from another method? Is there a 'safe' way without redirecting?]

2009-12-08 Thread Shailesh Kochhar
Shailesh Kochhar wrote: > Mike Orr wrote: >> On Mon, Dec 7, 2009 at 9:58 AM, Jonathan Vanasco >> wrote: >>> mike- >>> >>> on the subject... does Pylons have a subrequest facility ? >>> >>> Some platforms , like mod_perl , o

Re: Calling a controllers method from another method? Is there a 'safe' way without redirecting?

2009-12-07 Thread Shailesh Kochhar
Mike Orr wrote: > On Mon, Dec 7, 2009 at 9:58 AM, Jonathan Vanasco > wrote: >> mike- >> >> on the subject... does Pylons have a subrequest facility ? >> >> Some platforms , like mod_perl , offer it: >> >> http://perl.apache.org/docs/2.0/api/Apache2/SubRequest.html >> >> internal_redirect >> >> Re

Re: Calling a controllers method from another method? Is there a 'safe' way without redirecting?

2009-12-04 Thread Shailesh Kochhar
John_Nowlan wrote: > Sorry. I butchered the code when I was trying to make it an example. > It was self.login() . I'm saying this does not work, but I think it is a > fairly common case, i.e. some logic within a method causes you to want to > goto/call/transfer to a different method (usually base

Re: Persistent connections

2009-11-18 Thread Shailesh Kochhar
Jonathan Vanasco wrote: > the paste source has a close_connection attribute / param in > HTTPRequest > > http://pythonpaste.org/script/paste/script/wsgiserver/__init__.py.html?f=87&l=480#87 > > maybe your app is configured to close the connection after every > request ? > > or maybe httplib d

Persistent connections

2009-11-18 Thread Shailesh Kochhar
Hello, I'm not sure if this is the right forum for this question or if the paste-users list is more appropriate. Trying here first. I'm trying to reuse http connections when talking to my pylons application using httplib. However, the Paste WSGI server closes the connection before it can be r

Re: jsonify validator

2009-09-23 Thread Shailesh Kochhar
Qiangning Hong wrote: > On Wed, Sep 23, 2009 at 1:17 PM, Mike Orr wrote: >> On Tue, Sep 22, 2009 at 8:06 PM, Jonathan Vanasco >> wrote: >>> by default it sets response.content_type to "application/json" >>> >>> is there a way to override this? >>> if not , could I request this in a future versi

Re: jsonify validator

2009-09-23 Thread Shailesh Kochhar
Mike Orr wrote: > On Tue, Sep 22, 2009 at 8:06 PM, Jonathan Vanasco > wrote: >> by default it sets response.content_type to "application/json" >> >> is there a way to override this? >> if not , could I request this in a future version of pylons ? >> >> though testing, i discovered that a lot of

Re: Corruption of POST bodies in middleware [was: Re: empty POST dictionary for post request when using webob.Request in middleware]

2009-09-18 Thread Shailesh Kochhar
kochhar wrote: > Hi, > > I'm running into a problem with POST data in Pylons 0.9.6. I have a simple > middleware which copies the environ, wraps it in a paste WSGIRequest, > checks the request for a parameter and then passes the environ to the > inner apps. When I do this, request.params and r