Module typeconversions
source code
Conversions between type systems.
The DC software has to deal with a quite a few type systems (see
base.typesystems). In general, we keep metadata in the SQL type system;
in particular, column's and param's type attribute takes values in
that.
In fact, we use a couple of extensions:
-
file -- this corresponds to a file upload from the web (i.e., a pair
(filename, file object)). It would be conceivable to turn this into
blobs at some point, but right now we simply don't touch it.
-
vexpr-float, -text, -date, -mjd -- vizier-like expressions coming in
from the web. These are always strings.
-
raw -- handed right through, whatever it is. For target formats that
can't do this, usually strings are used.
-
unicode -- this is TEXT in the database, but while normal text will
be rendered as byte strings in VOTables (with non-ASCII-characters
replaced by ?), unicode will become an array of unicodeChars.
This module contains a base class and the VOTable type system
conversion, as the VOTable module (that should not depend on base)
depends on it. The remaining actual converters are in base.typesystems,
as they may depend on details of base. Even the SQL converters should be
taken from there when code can rely on gavo.base; this module should be
considered an implementation detail.
|
|
|
voTableToSQLType(type,
arraysize,
xtype=None) |
source code
|
|
|
__package__ = ' gavo.utils '
|