Re: Share your Pylons best-practices?

2010-07-21 Thread Mike Orr
On Wed, Jul 21, 2010 at 5:44 PM, BrianTheLion wrote: > I was > hoping that some of the more experienced Pylons crew would take a few > minutes and maybe help compile some "best-practices" that will allow > others get off the ground more quickly. There aren't really any definitive answers to these

Re: pylons 1.0 and possible redirect bug ?

2010-07-21 Thread Wyatt Baldwin
On Jul 21, 7:13 pm, huydo wrote: > On Jul 22, 2:17 am, Wyatt Baldwin wrote: > > > > > > > On Jul 21, 5:56 am, huydo wrote: > > > > Hi, > > > > Just trying to do a direct from the __call__ method in my base.py file > > > and this is the following exception which I am getting. > > > >   redirect(u

Re: Share your Pylons best-practices?

2010-07-21 Thread cd34
There was a brief discussion about the controllers in April: http://groups.google.com/group/pylons-discuss/browse_thread/thread/bcdddffc643cca7a/8a976271d6b990b5 I use multiple controllers. My database schema (and form schemas) are in my models directory. My Controllers generally segregate func

Re: pylons 1.0 and possible redirect bug ?

2010-07-21 Thread huydo
On Jul 22, 2:17 am, Wyatt Baldwin wrote: > On Jul 21, 5:56 am, huydo wrote: > > > > > Hi, > > > Just trying to do a direct from the __call__ method in my base.py file > > and this is the following exception which I am getting. > > >   redirect(url(controller='redirect', action='index')) > > Fil

Share your Pylons best-practices?

2010-07-21 Thread BrianTheLion
Hi all, I've been dabbling in Pylons for about a year now, bringing myself up to speed on an outstanding enabling technology that shows real depth and breadth. An experienced Python programmer, I am quite impressed. The software is mature, and implements a lot of great insight into what it takes t

pkg_resources barfing on pip requirements file format

2010-07-21 Thread Yang Zhang
When using paste, e.g. loadapp, it goes through setuptools/pkg_resources, which goes through your app's requires.txt. Any hacks to allow for pip requirements syntax? (http://pip.openplans.org/requirement-format.html) Currently if I try the following, for instance: -f http://protobuf-socket-rpc

Re: Returning a file object from an action

2010-07-21 Thread Mike Orr
On Wed, Jul 21, 2010 at 1:03 PM, Jens Hoffrichter wrote: > Hi, > > On 21 July 2010 21:40, Mike Orr wrote: >> On Wed, Jul 21, 2010 at 12:33 PM, Ian Wilson >> wrote: >>> Hello, >>> >>> I think you want something like this. >>> >>> from paste.fileapp import FileApp >>> >>> # in controller

Re: Returning a file object from an action

2010-07-21 Thread Jens Hoffrichter
Hi, On 21 July 2010 21:40, Mike Orr wrote: > On Wed, Jul 21, 2010 at 12:33 PM, Ian Wilson > wrote: >> Hello, >> >> I think you want something like this. >> >> from paste.fileapp import FileApp >> >> # in controller >>     #...in some action, get the path to serve >>     wsgi_ap

Re: Returning a file object from an action

2010-07-21 Thread Wichert Akkerman
On 2010-7-21 21:40, Mike Orr wrote: On Wed, Jul 21, 2010 at 12:33 PM, Ian Wilson wrote: Hello, I think you want something like this. from paste.fileapp import FileApp # in controller #...in some action, get the path to serve wsgi_app = FileApp(path) return

Re: Returning a file object from an action

2010-07-21 Thread Mike Orr
On Wed, Jul 21, 2010 at 12:33 PM, Ian Wilson wrote: > Hello, > > I think you want something like this. > > from paste.fileapp import FileApp > > # in controller >     #...in some action, get the path to serve >     wsgi_app = FileApp(path) >     return wsgi_app(request.environ

Re: Returning a file object from an action

2010-07-21 Thread Ian Wilson
Hello, I think you want something like this. from paste.fileapp import FileApp # in controller #...in some action, get the path to serve wsgi_app = FileApp(path) return wsgi_app(request.environ, self.start_response) A better solution you might want to look into

Returning a file object from an action

2010-07-21 Thread Jens Hoffrichter
Hi everyone, I looked into the documentation, but couldn't find any mentioning of what I could return from an action. I know that I can return a string, most likely rendered from a template. Is it possible to return a file object from an action, so that the contents of the file will be delivered

Re: pylons 1.0 and possible redirect bug ?

2010-07-21 Thread Wyatt Baldwin
On Jul 21, 5:56 am, huydo wrote: > Hi, > > Just trying to do a direct from the __call__ method in my base.py file > and this is the following exception which I am getting. > >   redirect(url(controller='redirect', action='index')) > File 'c:\\apps\\xbits\\ktrack\\python\\lib\\site-packages\\pylons

pylons 1.0 and possible redirect bug ?

2010-07-21 Thread huydo
Hi, Just trying to do a direct from the __call__ method in my base.py file and this is the following exception which I am getting. redirect(url(controller='redirect', action='index')) File 'c:\\apps\\xbits\\ktrack\\python\\lib\\site-packages\\pylons-1.0- py2.5.egg\\pylons\\controllers\\util.py'