Get response body from different controller

0 views
Skip to first unread message

Tim Black

unread,
Jul 25, 2007, 7:58:22 PM7/25/07
to turbo...@googlegroups.com
Any suggestions on how to imitate the functionality of the following in a controller?  I'm trying to create the body of an HTML email from the output of a controller/template combo.

        from turbogears import testutil
        testutil.createRequest("/projectBill/1")
        cpResponse = response.body[0]

Tim Black

Richard Clark

unread,
Jul 25, 2007, 8:14:44 PM7/25/07
to TurboGears
To get the response from another controller, just call it directly (if
you can)

ie, htmlResult = myController.myMethod(arg1, arg2)

The @expose() templating effect will take place before you get the
result, so you'll get the HTML back.

Reply all
Reply to author
Forward
0 new messages