Module n.rend

Part of nevow View Source

Page, Fragment and other standard renderers.

This module contains classes and function responsible for rendering dynamic content and a few useful mixin classes for inheriting common functionality.

Mostly, you'll use the renderers:
Line # Kind Name Docs
57 Class RenderFactory No class docstring; 1/1 methods documented
87 Class MacroFactory No class docstring; 1/1 methods documented
111 Class DataNotFoundError Raised when a data directive could not be resolved on the page or its
117 Class DataFactory Undocumented
145 Class FreeformChildMixin Mixin that handles locateChild for freeform segments.
176 Class ConfigurableMixin A sane IConfigurable implementation for Fragment and Page.
256 Class ConfigurableFactory Locates configurables by looking for methods that start with
320 Function defaultsFactory Undocumented
332 Function errorsFactory Undocumented
345 Function handFactory Undocumented
351 Function statusFactory Undocumented
357 Function originalFactory Undocumented
361 Class Fragment A fragment is a renderer that can be embedded in a stan document and
450 Class ChildLookupMixin No class docstring; 2/3 methods documented
515 Class Page A page is the main Nevow resource and renders a document loaded
700 Function sequence Renders each item in the sequence using patterns found in the
759 Function mapping Fills any slots in the element's children with data from a
776 Function string Undocumented
780 Function data Replace the tag's content with the current data.
786 Class FourOhFour A simple 404 (not found) page.
def defaultsFactory(ctx): (source)
Undocumented
def errorsFactory(ctx): (source)
Undocumented
def handFactory(ctx): (source)
Undocumented
def statusFactory(ctx): (source)
Undocumented
def originalFactory(ctx): (source)
Undocumented
def sequence(context, data): (source)

Renders each item in the sequence using patterns found in the children of the element.

Sequence recognises the following patterns:
  • header: Rendered at the start, before the first item. If multiple header patterns are provided they are rendered together in the order they were defined.
  • footer: Just like the header only renderer at the end, after the last item.
  • item: Rendered once for each item in the sequence. If multiple item patterns are provided then the pattern is cycled in the order defined.
  • divider: Rendered once between each item in the sequence. Multiple divider patterns are cycled.
  • empty: Rendered instead of item and divider patterns when the sequence contains no items.
Example:
<table nevow:render="sequence" nevow:data="peopleSeq">
  <tr nevow:pattern="header">
    <th>name</th>
    <th>email</th>
  </tr>
  <tr nevow:pattern="item" class="odd">
    <td>name goes here</td>
    <td>email goes here</td>
  </tr>
  <tr nevow:pattern="item" class="even">
    <td>name goes here</td>
    <td>email goes here</td>
  </tr>
  <tr nevow:pattern="empty">
    <td colspan="2"><em>they've all gone!</em></td>
  </tr>
</table>
def mapping(context, data): (source)

Fills any slots in the element's children with data from a dictionary. The dict keys are used as the slot names, the dict values are used as filling.

Example:
<tr nevow:render="mapping" nevow:data="personDict">
  <td><nevow:slot name="name"/></td>
  <td><nevow:slot name="email"/></td>
</tr>
def string(context, data): (source)
Undocumented
def data(context, data): (source)
Replace the tag's content with the current data.
API Documentation for Nevow, generated by pydoctor.