gavo.svcs.outputdef module

Output tables and their components.

class gavo.svcs.outputdef.OutputField(parent, **kwargs)[source]

Bases: Column

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 t.w.template stan. In addition to the standard `Functions available for row makers`_ you have queryMeta and t.w.template’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]" 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 to data, you see rd and queryMeta.

attrSeq = [<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.attrdef.BooleanAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>, <gavo.rscdef.column.TableManagedAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>, <gavo.base.attrdef.BooleanAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>, <gavo.base.attrdef.StringSetAttribute object>, <gavo.base.attrdef.IntAttribute object>, <gavo.base.parsecontext.OriginalAttribute object>, <gavo.base.complexattrs.PropertyAttribute object>, <gavo.base.attrdef.BooleanAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>, <gavo.rscdef.column.DisplayHintAttribute object>, <gavo.base.structure.DataContent object>, <gavo.base.attrdef.UnicodeAttribute object>, <gavo.rscdef.column.DMRolesAttribute object>, <gavo.base.parsecontext.IdAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>]
clearProperty(name)
completeElement(ctx)[source]
completedCallbacks = []
expand(*args, **kwargs)[source]
classmethod fromColumn(col)[source]
getProperty(name, default=<Undefined>)
hasProperty(name)
managedAttrs = {'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>, 'meta': <gavo.base.meta.MetaAttribute object>, 'meta_': <gavo.base.meta.MetaAttribute object>, 'name': <gavo.rscdef.column.ColumnNameAttribute object>, 'note': <gavo.base.attrdef.UnicodeAttribute object>, 'original': <gavo.base.parsecontext.OriginalAttribute object>, 'properties': <gavo.base.complexattrs.PropertyAttribute object>, 'property': <gavo.base.complexattrs.PropertyAttribute object>, 'required': <gavo.base.attrdef.BooleanAttribute object>, 'select': <gavo.base.attrdef.UnicodeAttribute object>, 'sets': <gavo.base.attrdef.StringSetAttribute object>, 'stc': <gavo.rscdef.column.TableManagedAttribute object>, 'stcUtype': <gavo.rscdef.column.TableManagedAttribute object>, 'tablehead': <gavo.base.attrdef.UnicodeAttribute object>, 'type': <gavo.rscdef.column.TypeNameAttribute object>, 'ucd': <gavo.base.attrdef.UnicodeAttribute object>, 'unit': <gavo.base.attrdef.UnicodeAttribute object>, 'utype': <gavo.base.attrdef.UnicodeAttribute object>, 'values': <gavo.base.complexattrs.StructAttribute object>, 'verbLevel': <gavo.base.attrdef.IntAttribute object>, 'wantsRow': <gavo.base.attrdef.BooleanAttribute object>, 'xtype': <gavo.base.attrdef.UnicodeAttribute object>}
name_ = 'outputField'
setProperty(name, value)
class gavo.svcs.outputdef.OutputTableDef(parent, **kwargs)[source]

Bases: TableDef

A table that has outputFields for columns.

Cores always have one of these, but they are implicitly defined by the underlying database tables in case of dbCores and such.

Services may define output tables to modify what is coming back fromt the core. Note that this usually only affects the output to web browsers. To use the output table also through VO protocols (and when producing VOTables, FITS files, and the like), you need to set the service’s votableRespectsOutputTable property to True.

attrSeq = [<gavo.rscdef.tabledef.ADQLVisibilityAttribute object>, <gavo.rscdef.common.ProfileListAttribute object>, <gavo.dm.dmrd.DataModelRolesAttribute object>, <gavo.base.attrdef.StringListAttribute object>, <gavo.rscdef.common.ColumnListAttribute object>, <gavo.base.attrdef.EnumeratedUnicodeAttribute object>, <gavo.base.attrdef.BooleanAttribute object>, <gavo.base.complexattrs.StructListAttribute object>, <gavo.base.complexattrs.StructListAttribute object>, <gavo.base.parsecontext.IdAttribute object>, <gavo.base.complexattrs.StructListAttribute object>, <gavo.base.meta.MetaAttribute object>, <gavo.rscdef.mixins.MixinAttribute object>, <gavo.rscdef.common.NamePathAttribute object>, <gavo.base.attrdef.IntAttribute object>, <gavo.base.attrdef.BooleanAttribute object>, <gavo.base.parsecontext.OriginalAttribute object>, <gavo.rscdef.common.ColumnListAttribute object>, <gavo.rscdef.tabledef.ColumnTupleAttribute object>, <gavo.base.complexattrs.PropertyAttribute object>, <gavo.rscdef.common.RDAttribute object>, <gavo.rscdef.common.ProfileListAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.complexattrs.StructListAttribute object>, <gavo.base.complexattrs.StructListAttribute object>, <gavo.base.attrdef.BooleanAttribute object>, <gavo.base.attrdef.BooleanAttribute object>, <gavo.base.attrdef.IntAttribute object>, <gavo.base.attrdef.UnicodeAttribute object>]
clearProperty(name)
completeElement(ctx)[source]
completedCallbacks = []
classmethod fromColumns(columns, **kwargs)[source]

returns a TableDef from a sequence of columns.

You can give additional constructor arguments. makeStruct is used to build the instance, the mixin hack is applied.

Columns with identical names will be disambiguated.

classmethod fromTableDef(tableDef, ctx=None)[source]
getFullId()
getPrimaryIn(row)
getProperty(name, default=<Undefined>)
hasProperty(name)
iterAnnotationsOfType(typeName)

returns the first annotation of the type passed.

managedAttrs = {'adql': <gavo.rscdef.tabledef.ADQLVisibilityAttribute object>, 'allProfiles': <gavo.rscdef.common.ProfileListAttribute object>, 'autoCols': <gavo.base.attrdef.StringListAttribute object>, 'column': <gavo.rscdef.common.ColumnListAttribute object>, 'columns': <gavo.rscdef.common.ColumnListAttribute object>, 'dm': <gavo.dm.dmrd.DataModelRolesAttribute object>, 'dupePolicy': <gavo.base.attrdef.EnumeratedUnicodeAttribute object>, 'forceUnique': <gavo.base.attrdef.BooleanAttribute object>, 'foreignKey': <gavo.base.complexattrs.StructListAttribute object>, 'foreignKeys': <gavo.base.complexattrs.StructListAttribute object>, 'group': <gavo.base.complexattrs.StructListAttribute object>, 'groups': <gavo.base.complexattrs.StructListAttribute object>, 'id': <gavo.base.parsecontext.IdAttribute object>, 'index': <gavo.base.complexattrs.StructListAttribute object>, 'indices': <gavo.base.complexattrs.StructListAttribute object>, 'meta': <gavo.base.meta.MetaAttribute object>, 'meta_': <gavo.base.meta.MetaAttribute object>, 'mixin': <gavo.rscdef.mixins.MixinAttribute object>, 'namePath': <gavo.rscdef.common.NamePathAttribute object>, 'nrows': <gavo.base.attrdef.IntAttribute object>, 'onDisk': <gavo.base.attrdef.BooleanAttribute object>, 'original': <gavo.base.parsecontext.OriginalAttribute object>, 'outputField': <gavo.rscdef.common.ColumnListAttribute object>, 'param': <gavo.rscdef.common.ColumnListAttribute object>, 'params': <gavo.rscdef.common.ColumnListAttribute object>, 'primary': <gavo.rscdef.tabledef.ColumnTupleAttribute object>, 'properties': <gavo.base.complexattrs.PropertyAttribute object>, 'property': <gavo.base.complexattrs.PropertyAttribute object>, 'publish': <gavo.base.complexattrs.StructAttribute object>, 'rd': <gavo.rscdef.common.RDAttribute object>, 'readProfiles': <gavo.rscdef.common.ProfileListAttribute object>, 'register': <gavo.base.complexattrs.StructAttribute object>, 'registration': <gavo.base.complexattrs.StructAttribute object>, 'script': <gavo.base.complexattrs.StructListAttribute object>, 'scripts': <gavo.base.complexattrs.StructListAttribute object>, 'stc': <gavo.base.complexattrs.StructListAttribute object>, 'system': <gavo.base.attrdef.BooleanAttribute object>, 'temporary': <gavo.base.attrdef.BooleanAttribute object>, 'verbLevel': <gavo.base.attrdef.IntAttribute object>, 'viewStatement': <gavo.base.attrdef.UnicodeAttribute object>}
metaModel = None
mixesIn(mixinRef)
name_ = 'outputTable'
property rd
resolveName(context, id)
setProperty(name, value)
updateAnnotationFromChildren()