Default values aren't typed in MySQL tables w/ fromDatabase
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
The default values given in a MySQL table are passed in as string values in
the the 'MySQLConnection.columnsFromSchema' method.
For example, a simple table that describes a column like so:
age INT NOT NULL DEFAULT 0
...will actually create a IntCol object whose default is '0' (stringified zero).
Attached is a local patch I have to handle the various numeric and date/
time columns. Will follow-up with additional tests to verify the changes...
----------
Using Python 2.4.1 and SQLObject r1536
URL: http://svn.colorstudy.com/SQLObject/trunk
Repository UUID: 95a46c32-92d2-0310-94a5-8d71aeb3d4b3
Revision: 1536
diff file for the changes to mysql/mysqlconnection.py
Logged In: YES
user_id=4799
The patch is almost good, except for datetime. The patch
used datetime which is not available in Python 2.2
(SQLObject still supports Python 2.2). Please use the same
route as in col.py - check what is available and what is
prefered by the user.