Hi,
I want to know if it is best practice to include some result returned
by other controllers in a template.
For instance, I have a 'movie' controller and 'view' action, and in
the movie/view.mako template, I want to include the list of all
comments. I can, however, use <%include file='/comment/list.mako' />
in the template. But this requires extra code querying the database
for comments in the movie\view action, which may be duplicate with the
code in comment\list action.
Therefore, I want to directly include the return value of the comment
\list action in the movie/view.mako template, like:
<%
import myproj.controllers.comment import CommentController
%>
${CommentController().list()}
Is this a good idea, or there is other options?
--
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?hl=en.