http://docs.pylonsproject.org/docs/pyramid/en/latest/api/httpexceptions.html#pyramid.httpexceptions.exception_response
Mário Idival Python Developer *Twitter|Github|Skype *: *marioidival* *Facebook*: *mario.idival* *User Linux** : **#554446* 2015-05-08 14:58 GMT-03:00 Vincent Catalano <vinc...@vincentcatalano.com>: > I'm a little confused be what you mean when you say "exception_response". > Have you considered using Exception Views > http://pyramid-cookbook.readthedocs.org/en/latest/pylons/exceptions.html#exception-views? > The primary difference would be that you would want to return a 200 status > code instead of 500 so that jQuery will appropriately handle your response > like you want. > > On Thu, May 7, 2015 at 6:51 PM, Mário Idival <marioidi...@gmail.com> > wrote: > >> Hello Everyone, >> >> How can I return a value through the exception_response. >> >> Ex -> >> with jQuery usually we have this kind of code: >> // frontend >> $.post (url, params).done(function (response) { >> alert (response.somedata); // Alert -> "some data" >> }); >> >> #backend >> >> view_config (route_name = "someview" renderer = "json") >> def someview (request): >> # Do something >> {return "somedata": "some data"} >> >> >> How I can do that, using execption_response? >> >> execption_response(200, somedata="some data") >> >> ?? >> Mário Idival >> Python Developer >> >> *Twitter|Github|Skype *: *marioidival* >> *Facebook*: *mario.idival* >> *User Linux** : **#554446* >> >> -- >> You received this message because you are subscribed to the Google Groups >> "pylons-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to pylons-discuss+unsubscr...@googlegroups.com. >> To post to this group, send email to pylons-discuss@googlegroups.com. >> Visit this group at http://groups.google.com/group/pylons-discuss. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Vincent Catalano > Software Engineer and Web Developer, > (520).603.8944 > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pylons-discuss+unsubscr...@googlegroups.com. > To post to this group, send email to pylons-discuss@googlegroups.com. > Visit this group at http://groups.google.com/group/pylons-discuss. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscr...@googlegroups.com. To post to this group, send email to pylons-discuss@googlegroups.com. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.