Home | Trees | Indices | Help |
|
---|
|
Template processing for TurboGears view layer.
The template engines are configured and loaded here and this module provides the generic template rendering function "render", which selects the template engine to use and the appropriate output format, headers and encoding based on the given arguments and the application configuration.
Also defines the functions and variables that will be available in the template scope and provides a hook for adding additional template variables.
Classes | |
cycle Loops forever over an iterator. |
|
UserAgent Representation of the user's browser. |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Variables | |
log = logging.getLogger("turbogears.view")
|
|
baseTemplates =
|
|
variable_providers = []
|
|
root_variable_providers =
|
|
engines =
|
|
__package__ =
|
Function Details |
Renders data in the desired format.
|
Load base templates for use by other templates. By listing templates in turbogears.view.baseTemplates, these templates will automatically be loaded so that the "import" statement in a template will work. |
If the expression is true, return the string 'selected'. Useful for HTML <option>s. |
If the expression is true, return the string "checked". This is useful for checkbox inputs. |
Lets you look at the first item in an iterator. This is a good way to verify that the iterator actually contains something. This is useful for cases where you will choose not to display a list or table if there is no data present. |
If this is an ElementTree element, convert it to a markup stream. If this is a list, apply this function recursively and chain everything. |
Create a Bunch of variables that should be available in all templates. These variables are: checker the checker function config the cherrypy config get function cycle cycle through a set of values errors validation errors identity the current visitor's identity information inputs input values from a form ipeek the ipeek function locale the default locale quote_plus the urllib quote_plus function request the cherrypy request selector the selector function session the current cherrypy.session if the session_filter.on it set in the app.cfg configuration file. If it is not set then session will be None. tg_js the url path to the JavaScript libraries tg_static the url path to the TurboGears static files tg_toolbox the url path to the TurboGears toolbox files tg_version the version number of the running TurboGears instance url the turbogears.url function for creating flexible URLs useragent a UserAgent object with information about the browser Additionally, you can add a callable to turbogears.view.variable_providers that can add more variables to this list. The callable will be called with the vars Bunch after these standard variables have been set up. |
Load and initialize all templating engines. This is called during startup after the configuration has been loaded. You can call this earlier if you need the engines before startup; the engines will then be reloaded with the custom configuration later. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Jul 14 21:45:36 2011 | http://epydoc.sourceforge.net |