Re: [SQLObject] Quoting reserved column names...
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Dan P. <da...@ag...> - 2009-06-11 09:31:04
|
On 11 Jun 2009, at 11:23, jonhattan wrote: > Sam's Lists escribió: >> So I keep humming along on this upgrade of someone else's code from >> old versions of SQLObject and Mysql to the current SQLObject and >> MySQL >> 5... >> >> The current problem is that I have a table with the column name >> 'condition' which apparently is not a reserved word in MySQL 4.0 but >> is a reserved word in 5.0. >> >> When SQLObject translates its stuff to sql it does not put quotes >> around the column names. If it only would everything would work >> fine. >> >> I could rename the column, but the word is used a lot in the program >> in different ways, so it will get confusing to make sure I only >> change >> the right ones . >> >> Is there a way to force SQLObject to quote it properly? >> > you can force the name of the column in the database this way: > > condition = StringCol(dbName='_condition') Or simply quote it and you do not need to change anything: condition = StringCol(dbName='`condition`') -- Dan |