Package json_to_relation :: Module json_to_relation :: Class ColumnSpec
[hide private]
[frames] | no frames]

Class ColumnSpec

source code

object --+
         |
        ColumnSpec

Housekeeping class. Each instance represents the name, position, and datatype of one column. These instances are used to generate column name headers, Django models, and SQL insert statements.

Instance Methods [hide private]
 
__init__(self, colName, colDataType, jsonToRelationProcessor)
Create a ColumnSpec instance.
source code
String
getName(self)
Return column name
source code
String
getType(self)
Return SQL type
source code
 
getSQLDefSnippet(self)
Return string snippet to use in SQL CREATE TABLE or ALTER TABLE statement
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, colName, colDataType, jsonToRelationProcessor)
(Constructor)

source code 

Create a ColumnSpec instance.

Parameters:
  • colName (String) - name of column
  • colDataType (ColumnSpec) - data type of column (an enum)
  • jsonToRelationProcessor (JSONToRelation) - associated JSON to relation JSONToRelation instance
Overrides: object.__init__

getName(self)

source code 

Return column name

Returns: String
name of column

getType(self)

source code 

Return SQL type

Returns: String
SQL type of colum in upper case

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)