On Nov 14, 2003, at 2:10 AM, Randall Randall wrote:
> On Friday, November 14, 2003, at 02:04 AM, Mike Moum wrote:
>
>> Hi,
>>
>> I have the following test code:
>>
>> from SQLObject import *
>> import MySQLdb
>>
>> conn = MySQLdb.connect()
>> conn.cursor().execute('create database mike')
>> conn.close()
>>
>> compcode = 'mike'
>> conn = MySQLConnection(user = '', db = 'mike')
>>
>> class Person(SQLObject):
>> _connection = conn
>> firstName = StringCol(length = 20, default = None)
>> lastName = StringCol(length = 20, default = None)
>> index = IntCol()
>
> The word "index" is reserved in MySQL.
>
> You should use
> myIndex = IntCol()
> if you have to have a separate index.
Good catch. You can also do
index = IntCol(colName="person_index")
--
Ian Bicking | ia...@co... | http://blog.ianbicking.org
|