#1989: Stacked @expose() does not work
------------------------+---------------------------------------------------
 Reporter:  h2o         |       Owner:  anonymous
     Type:  defect      |      Status:  new      
 Priority:  normal      |   Milestone:  2.0      
Component:  TurboGears  |     Version:  trunk    
 Severity:  major       |    Keywords:           
------------------------+---------------------------------------------------
 According to the documentation for expose and the examples in the current
 2.0 wiki one should be able to stack multiple @expose on a function like
 this:


 {{{
 @expose("json")
 @expose("myapp.templates.test", content_type="text/html")
 def testcase(self):
         mylist = ["Hello", "World"]
         return dict(mylist=mylist)
 }}}

 But, trying to fetch the data I can only get the HTML version. If I remove
 the @expose for the template, then I do get json data without any problem.
 But when both are present it does not work!

 I did the requests using jQuery and the headers looked like this:

 Response headers
 {{{
 Server  PasteWSGIServer/0.5 Python/2.5.2
 Date    Tue, 16 Sep 2008 13:45:30 GMT
 Pragma  no-cache
 Cache-Control   no-cache
 Content-Type    text/html; charset=utf-8
 Content-Length  1141
 }}}

 Request Headers
 {{{
 Host    localhost:8080
 User-Agent      Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.1)
 Gecko/2008072820 Firefox/3.0.1
 Accept  application/json, text/javascript, */*
 Accept-Language sv,en;q=0.7,en-us;q=0.3
 Accept-Encoding gzip,deflate
 Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
 Keep-Alive      300
 Connection      keep-alive
 X-Requested-With        XMLHttpRequest
 Referer http://localhost:8080/testcase
 Cookie  session_id=0.348120876898; filter=; category=;
 torrent_info_tab=details;
 beaker.session.id=8009b7da4e77a375fef5d6c7160c0a09
 }}}

-- 
Ticket URL: <http://trac.turbogears.org/ticket/1989>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to