close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Opened 16 years ago

#9 new

Template rendering outside of web requests

Reported by: cmlenz Owned by: cmlenz
Priority: major Milestone: 1.0
Component: templating Keywords:
Cc:

Description

It should be easier to render a Genshi template with the default data outside of the normal request handler @output()/render() cycle.

For example, the moderation module in Divan currently uses the following code to render a plain text email:

template = app.templates.load('moderation/notification.txt',
                              cls=NewTextTemplate)
body = template.generate(post=post, reaction=reaction,
                         abs_url=abs_url, path_to=path_to,
                         quote=quote).render()

Note how it needs to pass the data that is normally available by default. This should be a one or two liner, at most.

Change History (0)

Note: See TracTickets for help on using tickets.