In my case, all of my controllers use the same content type, so it
made sense to create a base class.

On Jun 2, 1:59 am, Anand Chitipothu <[email protected]> wrote:
> 2011/6/2 Pete Emerson <[email protected]>:
>
> > Aha, thank you, Ben! After putting in your solution and seeing it
> > work, I tried to get the headers in the hello class, and it works (and
> > the simple nosetest I wrote works too):
>
> > class hello:
> >    def __init__(self):
> >        return web.header('Content-Type', 'text/html')
>
> >    def GET(self):
> >        return 'Hello, world!'
>
> > As to whether this is the 'right' or 'best' way, I don't know. But it works.
>
> Why not this?
>
> class hello:
>     def GET(self):
>         web.header('Content-Type', 'text/html')
>         return "Hello, world!"

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to