Part of nevow.inevow View Source View In Hierarchy
Known implementations: nevow.query.QueryContext, nevow.stan.Tag
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 15 | Method | patternGenerator | Returns a pseudo-Tag which will generate clones of matching |
| 33 | Method | allPatterns | Return a list of all matching pattern tags, cloned. |
| 42 | Method | onePattern | Return a single matching pattern, cloned. |
| 51 | Method | keyed | Locate the node with the key 'key', clone it, call fillSlots(key, clone) |
Returns a pseudo-Tag which will generate clones of matching pattern tags forever, looping around to the beginning when running out of unique matches.
If no matches are found, and default is None, raise an exception, otherwise, generate clones of default forever.
You can use the normal stan syntax on the return value.
Useful to find repeating pattern elements. Example rendering function:
>>> def simpleSequence(context, data):
... pattern = IQ(context).patternGenerator('item')
... return [pattern(data=element) for element in data]
Return a list of all matching pattern tags, cloned.
Useful if you just want to insert them in the output in one place.
E.g. the sequence renderer's header and footer are found with this.Return a single matching pattern, cloned. If there is more than one matching pattern or no matching patterns, raise an exception.
Useful in the case where you want to locate one and only one sub-tag and do something with it.Locate the node with the key 'key', clone it, call fillSlots(key, clone) and return the clone.
This method lets you effectively locate and mutate a node in the DOM. It is useful for setting the data special on a specific node, and also for calling fillSlots on a specific node, as well as other node-mutation operations such as setting a handler or assigning a class or id to a node.