Package ldaptor :: Module weave
[show private | hide private]
[frames | no frames]

Module ldaptor.weave

Classes
IZebraStyle Marker interface for zebra.
LDAPEntryContainer  
_DictLike  

Function Summary
  dnSerializer(original, context)
  entrySerializer(original, context)
  keyvalue(context, data)
Render items in a mapping using patterns found in the children of the element.
  keyvalue_item(context, data)
  zebra(styles)
Provide alternating background colors for e.g.

Function Details

keyvalue(context, data)

Render items in a mapping using patterns found in the children of the element.

Keyvalue recognizes 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. Can contain subpatterns key and value.

    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>

zebra(styles=['zebra-odd', 'zebra-even'])

Provide alternating background colors for e.g. zebra tables.
Parameters:
styles -

Two or more CSS class names to iterate.

Use like this:
 render_zebra = weave.zebra()

 <table>
   <tr nevow:render="zebra"><td>foo</td></tr>
   <tr nevow:render="zebra"><td>bar</td></tr>
   <tr nevow:render="zebra"><td>baz</td></tr>
 </table>

Generated by Epydoc 2.1 on Fri May 6 14:57:58 2005 http://epydoc.sf.net