From: Ian B. <ia...@co...> - 2003-09-22 17:31:05
|
On Monday, September 22, 2003, at 12:23 PM, cvigny wrote: > CREATE TABLE `url` ( > `id` int(25) unsigned NOT NULL auto_increment, > `idprotocol` int(3) unsigned NOT NULL default '0', > PRIMARY KEY (`id`) > ) TYPE=MyISAM > CREATE TABLE `protocol` ( > `id` int(3) unsigned NOT NULL auto_increment, > `protocol` varchar(50) NOT NULL default '', > PRIMARY KEY (`id`) > ) TYPE=MyISAM > from SQLObject import * > > import Config > > debug=1 > __connection__= MySQLConnection(host=Config.DB_HOST, > user=Config.DB_USERNAME, passwd=Config.DB_PASSWORD, > db="url",debug=debug) > > class MyStyle(Style): > def tableReference(self, table): > return "id" + table.lower() > > __connection__.style = MyStyle(longID=True) I think you don't want longID=True. That means the primary key will be prefixed with the table name (like protocol_id), but you are using just "id" for the primary key. Ian |