Package gavo :: Package user :: Module info :: Class AnnotationMaker
[frames] | no frames]

Class AnnotationMaker

source code

object --+
         |
        AnnotationMaker

A class for producing column annotations.

An annotation simply is a dictionary with some well-known keys. They are generated from DB queries. It is this class' responsibility to collect the DB query result columns pertaining to a column and produce the annotation dictionary from them.

To make this happen, it is constructed with the column; then, for each property queried, addPropertyKey is called. Finally, addAnnotation is called with the DB result row (see annotateDBTable) to actually make and attach the dictionary.

Instance Methods
 
__init__(self, column)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
doesWork(self) source code
 
getOutputFieldFor(self, propName, propFunc, nameMaker)
returns an OutputField that will generate a propName annotation from the propFunc function.
source code
 
annotate(self, resultRow)
builds an annotation of the column form resultRow.
source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, column)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

getOutputFieldFor(self, propName, propFunc, nameMaker)

source code 

returns an OutputField that will generate a propName annotation from the propFunc function.

propFunc for now has a %(name)s where the column name must be inserted.

nameMaker is something like a base.VOTNameMaker.

annotate(self, resultRow)

source code 

builds an annotation of the column form resultRow.

resultRow is a dictionary containing values for all keys registred through addPropertyKey.

If the column already has an annotation, only the new keys will be overwritten.