Package gavo :: Package rscdef :: Module column :: Class Values
[frames] | no frames]

Class Values

source code

                   object --+            
                            |            
 base.structure.StructureBase --+        
                                |        
                   object --+   |        
                            |   |        
           base.common.Parser --+        
                                |        
base.structure.ParseableStructure --+    
                                    |    
             base.structure.Structure --+
                                        |
                                       Values

Information on a column's values, in particular its domain.

This is quite like the values element in a VOTable. In particular, to accomodate VOTable usage, we require nullLiteral to be a valid literal for the parent's type.

Note that DaCHS does not validate for contraints from values on table import. This is mainly because before gavo values has run, values may not represent the new dataset in semiautomatic values.

With HTTP parameters, values validation does take place (but again, that's mostly not too helpful because there are query languages sitting in between most of the time).

Hence, the main utility of values is metadata declaration, both in the form renderer (where they become placeholders) and in datalink (where they are communicated as VOTable values).

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods
 
makePythonVal(self, literal, sqltype) source code
 
onParentComplete(self)
converts min, max, and options from string literals to python objects.
source code
 
validateOptions(self, value)
returns false if value isn't either in options or doesn't consist of items in options.
source code

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, completeElement, finishElement, onElementComplete, 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
 
fromOptions(cls, labels)
returns Values with the elements of labels as valid options.
source code

Inherited from base.structure.StructureBase: fromStructure

Class Variables
  name_ = 'values'
a sentinel for all kinds of undefined values.
  validValues = None
hash(x)
  attrSeq = [<gavo.base.attrdef.BooleanAttribute object>, <gavo....
  managedAttrs = {'caseless': <gavo.base.attrdef.BooleanAttribut...

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties

Inherited from object: __class__

Method Details

validateOptions(self, value)

source code 

returns false if value isn't either in options or doesn't consist of items in options.

Various null values always validate here; non-null checking is done by the column on its required attribute.


Class Variable Details

attrSeq

Value:
[<gavo.base.attrdef.BooleanAttribute object>,
 <gavo.base.attrdef.UnicodeAttribute object>,
 <gavo.base.attrdef.ActionAttribute object>,
 <gavo.base.parsecontext.IdAttribute object>,
 <gavo.base.attrdef.UnicodeAttribute object>,
 <gavo.base.attrdef.UnicodeAttribute object>,
 <gavo.base.attrdef.BooleanAttribute object>,
 <gavo.base.attrdef.UnicodeAttribute object>,
...

managedAttrs

Value:
{'caseless': <gavo.base.attrdef.BooleanAttribute object>,
 'default': <gavo.base.attrdef.UnicodeAttribute object>,
 'fromdb': <gavo.base.attrdef.ActionAttribute object>,
 'id': <gavo.base.parsecontext.IdAttribute object>,
 'max': <gavo.base.attrdef.UnicodeAttribute object>,
 'min': <gavo.base.attrdef.UnicodeAttribute object>,
 'multiOk': <gavo.base.attrdef.BooleanAttribute object>,
 'nullLiteral': <gavo.base.attrdef.UnicodeAttribute object>,
...