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

Module weave

source code

Classes [hide private]
  _DictLike
  LDAPEntryContainer
  IZebraStyle
Marker interface for zebra.
Functions [hide private]
 
keyvalue(context, data)
Render items in a mapping using patterns found in the children of the element.
source code
 
keyvalue_item(context, data) source code
 
dnSerializer(original, context) source code
 
entrySerializer(original, context) source code
 
zebra(styles=['zebra-odd', 'zebra-even'])
Provide alternating background colors for e.g.
source code
Variables [hide private]
  __warningregistry__ = {('compy.py module is deprecated, use zo...
Function Details [hide private]

keyvalue(context, data)

source code 

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'])

source code 
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>
    

Variables Details [hide private]

__warningregistry__

Value:
{('compy.py module is deprecated, use zope.interface and twisted.pytho\
n.components.registerAdapter directly.',
  <type 'exceptions.UserWarning'>,
  2): 1}