Package gavo :: Package svcs :: Module service :: Class CustomRF
[frames] | no frames]

Class CustomRF

source code

                   object --+                
                            |                
 base.structure.StructureBase --+            
                                |            
                   object --+   |            
                            |   |            
           base.common.Parser --+            
                                |            
base.structure.ParseableStructure --+        
                                    |        
             base.structure.Structure --+    
                                        |    
                           object --+   |    
                                    |   |    
      base.structure.RestrictionMixin --+    
                                        |    
                       CustomPageFunction --+
                                            |
                                           CustomRF

A custom render function for a service.

Custom render functions can be used to expose certain aspects of a service to Nevow templates. Thus, their definition usually only makes sense with custom templates, though you could, in principle, override built-in render functions.

In the render functions, you have the names ctx for nevow's context and data for whatever data the template passes to the renderer.

You can return anything that can be in a stan DOM. Usually, this will be a string. To return HTML, use the stan DOM available under the T namespace.

As an example, the following code returns the current data as a link:

       return ctx.tag[T.a(href=data)[data]]

You can access the embedding service as service, the embedding RD as service.rd.

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods

Inherited from CustomPageFunction: onElementComplete

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, completeElement, finishElement, validate

Inherited from base.structure.ParseableStructure: __init__, end_, feed, feedFrom, feedObject, getAttribute, iterEvents, start_, value_

Inherited from base.structure.StructureBase: __providedBy__, adopt, breakCircles, change, copy, getAttributes, getCopyableAttributes, getSourcePosition, iterChildren, setPosition

Inherited from base.common.Parser: feedEvent

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods

Inherited from base.structure.StructureBase: fromStructure

Class Variables
  name_ = 'customRF'
a sentinel for all kinds of undefined values.

Inherited from CustomPageFunction: attrSeq, managedAttrs

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties

Inherited from object: __class__