Class n.q.QueryContext(tpc.Adapter):

Part of nevow.query View Source View In Hierarchy

Implements interfaces: nevow.inevow.IQ

Undocumented

Split Table into Classes Show Methods in One Table

Line # Kind Name Docs
20 Method patternGenerator Returns a pseudo-Tag which will generate clones of matching
23 Method allPatterns Return a list of all matching pattern tags, cloned.
29 Method onePattern Return a single matching pattern, cloned.

Inherited from Adapter:

Line # Kind Name Docs
168 Method __init__ Set my 'original' attribute to be the object I am adapting.
173 Method __conform__ I forward __conform__ to self.original if it has it, otherwise I
182 Method isuper Forward isuper to self.original
Line # Kind Name Docs
173 Method __conform__ I forward __conform__ to self.original if it has it, otherwise I
168 Method __init__ Set my 'original' attribute to be the object I am adapting.
23 Method allPatterns Return a list of all matching pattern tags, cloned.
182 Method isuper Forward isuper to self.original
29 Method onePattern Return a single matching pattern, cloned.
20 Method patternGenerator Returns a pseudo-Tag which will generate clones of matching
def patternGenerator(self, pattern, default=None): (source)

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]
def allPatterns(self, pattern): (source)

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.
def onePattern(self, pattern): (source)

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.
API Documentation for Nevow, generated by pydoctor.