Package wsatools :: Package DbConnect :: Module Schema :: Class Attribute
[hide private]

Class Attribute

source code


A table column attribute schema.

Instance Methods [hide private]
 
__init__(self)
Initialises an empty default table column attribute schema.
source code
 
__cmp__(self, other)
Overridden to compare based on the name attribute.
source code
str
__str__(self)
Returns: Attribute's name.
source code
str, int or float
getDefaultValue(self)
Returns: Attribute's default value with correct python type.
source code
bool
isNotFitsKey(self)
Returns: True if this attribute is not read from FITS header keywords.
source code
bool
isParsedFitsKey(self)
Returns: True if FITS header keyword value needs to be parsed.
source code
bool
isString(self)
Returns: True if this attribute is a string.
source code
 
parseDefaultValue(self, value)
Where a different --/N tag value is supplied to the SQL default, the given value should be replaced by the SQL default if it equals the --/N tag value.
source code
 
parseValue(self, value)
Takes a value and parses it to the correct Python data type for this attribute, handling default values and common problems.
source code

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

Class Variables [hide private]
  dataType = ''
SQL data type of attribute.
  defaultStr = ''
The default constraint SQL value.
  fitsHDU = 0
FITS header index where attribute is found.
  fitsKeyword = ''
FITS keyword where attribute comes from.
  isCatFile = False
Is the attribute from a catalogue file?
  name = ''
Name of attribute.
  sqlLine = ''
The raw, unparsed SQL schema line.
  tag = {}
Dictionary of user-defined tags referenced by tag name, eg '--/Q'.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initialises an empty default table column attribute schema.

Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Returns: str
Attribute's name.
Overrides: object.__str__

getDefaultValue(self)

source code 
Returns: str, int or float
Attribute's default value with correct python type.

isNotFitsKey(self)

source code 
Returns: bool
True if this attribute is not read from FITS header keywords.

isParsedFitsKey(self)

source code 
Returns: bool
True if FITS header keyword value needs to be parsed.

isString(self)

source code 
Returns: bool
True if this attribute is a string.

parseDefaultValue(self, value)

source code 

Where a different --/N tag value is supplied to the SQL default, the given value should be replaced by the SQL default if it equals the --/N tag value.

Parameters:
  • value - Value to parse with the correct Python data type.
Returns:
Given value unless it equals the --/N tag default value, in which case return the SQL default.

parseValue(self, value)

source code 

Takes a value and parses it to the correct Python data type for this attribute, handling default values and common problems.

Parameters:
  • value - Value read from e.g. FITS header or table, can be any type, typically string or the correct type.
Returns:
Given value unless it equals the --/N tag default value, in which case return the SQL default. If it fails, it returns None.