askel wrote:
> wyatt-bC wrote:
> > Howdy. I'm doing some AJAXy stuff and I can't seem to get a status code
> > other than 200.
> >
> > The relevant controller looks like this (sort of):
> >
> >     def show(self, blah, blah):
> >         # do stuff and set ``code`` depending on what happens
> >         # ...
> >         return render_response('/service/%s.myt' % template, code=code)
> >
> > Doesn't matter what I set ``code`` to. I always get status 200 back on
> > the client side.
> >
> > I screwed around with middleware.py (turning different apps off) and
> > that didn't help.
> >
> > Any ideas?
> >
>
> response = render_response(template)
> response.status_code = code
> return response

Thanks. I ended up with this:

return render_response('/service/%s.myt' % template, status_code=code)

--
Wyatt Baldwin
byCycle.org


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to