Class Basic_Conversion
source code
Output_Conversion --+
|
Basic_Conversion
The default conversion class used if none is specified.
It will convert the following MySQL data types:
- Integers (TINYINT, SMALLINT, INTEGER, MEDIUMINT, BIGINT): Integers or
Longs.
- DECIMAL: decimal.Decimal.
- FLOAT and DOUBLE: Floating point number.
- BIT: Integer or Long.
- TIMESTAMP: datetime.datetime.
- DATE: datetime.date.
- TIME: datetime.timedelta.
- DATETIME: datetime.datetime.
- YEAR: Integer.
- SET: List of strings.
- ENUM: String.
All other types are returned as strings. NULL values are returned as None.
|
__init__(self)
|
|
convert(self,
mysql_type,
value)
Convert a MySQL value to a Python object.
|
|
_integer(self,
value)
|
|
_float(self,
value)
|
|
_string(self,
value)
|
|
_decimal(self,
value)
|
|
_bit(self,
value)
|
|
_datetime(self,
value)
|
|
_date(self,
value)
|
|
_time(self,
value)
|
|
_set(self,
value)
|
Convert a MySQL value to a Python object.
-
- Returns:
- Returns the Python object.
- Overrides:
Output_Conversion.convert
- (inherited documentation)
|