Re: [SQLObject] cannot insert with Sybase
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2009-03-04 16:23:09
|
On Wed, Mar 04, 2009 at 04:13:54PM +0000, wzi...@co... wrote: > Hello Oleg and others, > > But if I use 'id' instead of 'title_id' I get: > > File "/diska/data/workspace/PyXtern/Bibliothek/eggs/SQLObject-0.10.4-py2.5.egg/sqlobject/main.py", line 1203, in __init__ > File "/diska/data/workspace/PyXtern/Bibliothek/eggs/SQLObject-0.10.4-py2.5.egg/sqlobject/main.py", line 1237, in _create > TypeError: titles() did not get expected keyword argument 'title_id' Oops, my fault, sorry. You must not declare the 'id' column. > I hope it helps if I use dots to preserve the indentation: > ======================================= > from.sqlobject.import.* > > class.titles(.SQLObject.): > > ....title_id = IntCol() > ....title = StringCol() > > ....class.sqlmeta: > ........print.'class.sqlmeta' > ........idName = 'title_id' > ........lazyUpdate = False Remove 'title_id = IntCol()' from the class declaration. idName is the only way to name the column, and 'id' is the only way to refer to the column. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |