Package gavo :: Package svcs :: Module outputdef :: Class OutputField
[frames] | no frames]

Class OutputField

source code

                   object --+                    
                            |                    
 base.structure.StructureBase --+                
                                |                
                   object --+   |                
                            |   |                
           base.common.Parser --+                
                                |                
base.structure.ParseableStructure --+            
                                    |            
             base.structure.Structure --+        
                                        |        
                           object --+   |        
                                    |   |        
                  base.meta.MetaMixin --+        
                                        |        
                 rscdef.column.ColumnBase --+    
                                            |    
                         rscdef.column.Column --+
                                                |
                                               OutputField

A column for defining the output of a service.

It adds some attributes useful for rendering results, plus functionality specific to certain cores.

The optional formatter overrides the standard formatting code in HTML (which is based on units, ucds, and displayHints). You receive the item from the database as data and must return a string or nevow stan. In addition to the standard `Functions available for row makers`_ you have queryMeta and nevow's tags in T.

Here's an example for generating a link to another service using this facility:

 <outputField name="more" 
     select="array[centerAlpha,centerDelta] as more" tablehead="More"
     description="More exposures near the center of this plate">
   <formatter><![CDATA[
     return T.a(href=base.makeSitePath("/lswscans/res/positions/q/form?"
               "POS=%s,%s&SIZE=1&INTERSECT=OVERLAPS&cutoutSize=0.5"
               "&__nevow_form__=genForm"%tuple(data)
               ))["More"] ]]>
   </formatter>
 </outputField>

Within the code, in addition do data, you see rd and queryMeta.

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods
 
__repr__(self)
repr(x)
source code
 
completeElement(self, ctx) source code
 
expand(self, *args, **kwargs) source code
 
clearProperty(self, name) source code
 
getProperty(self, name, default=<Undefined>) source code
 
hasProperty(self, name) source code
 
setProperty(self, name, value) source code

Inherited from rscdef.column.Column: getAnnotation, validate

Inherited from rscdef.column.ColumnBase: asInfoDict, getDDL, getDisplayHintAsString, getLabel, isEnumerated, isIndexed, isPrimary, onParentComplete, setMetaParent, validateValue

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, finishElement, onElementComplete

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 base.meta.MetaMixin: addMeta, buildRepr, copyMetaFrom, delMeta, getAllMetaPairs, getMeta, getMetaKeys, getMetaParent, isEmpty, iterMeta, keys, makeOriginal, setMeta, traverse

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

Class Methods
 
fromColumn(cls, col) source code

Inherited from base.structure.StructureBase: fromStructure

Class Variables
  name_ = 'outputField'
a sentinel for all kinds of undefined values.
  attrSeq = [<gavo.base.meta.MetaAttribute object>, <gavo.rscdef...
  managedAttrs = {'content_': <gavo.base.structure.DataContent o...

Inherited from rscdef.column.ColumnBase: restrictedMode

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties

Inherited from object: __class__

Method Details

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

completeElement(self, ctx)

source code 
Overrides: base.structure.Structure.completeElement

clearProperty(self, name)

source code 
Overrides: rscdef.column.ColumnBase.clearProperty

getProperty(self, name, default=<Undefined>)

source code 
Overrides: rscdef.column.ColumnBase.getProperty

hasProperty(self, name)

source code 
Overrides: rscdef.column.ColumnBase.hasProperty

setProperty(self, name, value)

source code 
Overrides: rscdef.column.ColumnBase.setProperty

Class Variable Details

attrSeq

Value:
[<gavo.base.meta.MetaAttribute object>,
 <gavo.rscdef.column.ColumnNameAttribute object>,
 <gavo.rscdef.column.TypeNameAttribute object>,
 <gavo.base.attrdef.UnicodeAttribute object>,
 <gavo.base.attrdef.UnicodeAttribute object>,
 <gavo.base.attrdef.NWUnicodeAttribute object>,
 <gavo.rscdef.column.TableManagedAttribute object>,
 <gavo.base.parsecontext.IdAttribute object>,
...

managedAttrs

Value:
{'content_': <gavo.base.structure.DataContent object>,
 'description': <gavo.base.attrdef.NWUnicodeAttribute object>,
 'displayHint': <gavo.rscdef.column.DisplayHintAttribute object>,
 'dmRoles': <gavo.rscdef.column.DMRolesAttribute object>,
 'fixup': <gavo.base.attrdef.UnicodeAttribute object>,
 'formatter': <gavo.base.attrdef.UnicodeAttribute object>,
 'hidden': <gavo.base.attrdef.BooleanAttribute object>,
 'id': <gavo.base.parsecontext.IdAttribute object>,
...