From: Scott R. <sc...@to...> - 2004-04-07 18:55:10
|
Person.new(firstName="Jose", lastName="Galvez") You were missing the .new ... On Wed, 2004-04-07 at 14:50, Andrew S. Garbutt wrote: > I am just starting out with SQLObject. It looks like a really nice > package that i can use to map some complex relations. However, in > starting out i ran into some trouble. The code that I used follows this > message, and matches the provided code in the documentation.. The error > occurs when i try p = Person(firstName="Jose", lastName="Galvez"). I am > using Python 2.3.3 on windows with SQLObject's Mostly Live CVS > Tarball. Any help would be greatly appreciated. > > -Andy > > [TRACEBACK] > raceback (most recent call last): > File "<interactive input>", line 1, in ? > TypeError: __new__() got an unexpected keyword argument 'lastName' > > > [CODE] > > from SQLObject import * > > __connection__ = MySQLConnection(host='169.237.122.232', > db='pydo', > user='root', > passwd='jerrymouse' > ) > > class Person(SQLObject): > firstName = StringCol() > middleInitial = StringCol(length=1, default=None) > lastName = StringCol() > > > Person.createTable() > > > p = Person(firstName="Jose", lastName="Galvez") > > print p > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss |