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.

Changes between Version 15 and Version 16 of RequestHandlers


Ignore:
Timestamp:
Sep 17, 2008, 10:07:26 PM (16 years ago)
Author:
cmlenz
Comment:

Some typo fixes and clarifications

Legend:

Unmodified
Added
Removed
Modified
  • RequestHandlers

    v15 v16  
    11= Request Handlers =
    22
    3 A request handler is a neutral name for what some other frameworks call “controllers” or “views”. It is simply a Python function that accepts the request and response objects as parameters, and returns a response.
     3A request handler is a neutral name for what some other frameworks call “controllers” or “views”. It is simply a Python function that accepts the request and response objects as parameters, and processes the request to generate a response in one way or another.
    44
    55{{{
     
    5858}}}
    5959
    60 If you do want to render a template, use the `render()` function to return a Genshi stream from the request handler. You pass any template data into the `render()` function as keyword arguments, and it will generate an output stream from the template based on the template data. The `render()` function also lets you override the template filename specified using the `@output` decorator: simple pass the template name as the first (and only) positional argument into `render()`.
     60If you do want to render a template, use the `render()` function to return a Genshi stream from the request handler. You pass any template data into the `render()` function as keyword arguments, and it will generate an output stream from the template based on the template data. The `render()` function also lets you override the template filename specified using the `@output` decorator: simply pass the template name as the first (and only) positional argument into `render()`.
    6161
    6262=== Default Template Data ===
     
    7777 `ngettext()`:: Function for translating a message including plural forms
    7878 `path_to()`:: Function for generating URLs based on the [UrlRouting routing configuration]
    79  `request`:: The `Request` object
    80  `response`:: The `Response` object
    81  `separated()`:: Helper function that adds separator strings to a list of strings
     79 `request`:: The `Request` object (as provided by the `webob` package)
     80 `response`:: The `Response` object (as provided by the `webob` package)
     81 `separated()`:: Helper function that converts a list of strings into a single string with added separators
    8282 `time`:: Python `time` class from the `datetime` module
    8383 `timedelta`:: Python `timedelta` class from the `datetime` module
    84  `truncate()`:: Helper function that truncates a string to a specified limit of characters
     84 `truncate()`:: Helper function that truncates a string to a specified limit of characters, taking word boundaries into account
    8585 `XML()`:: Function to parse a string as XML and return a markup stream
    8686