Re: [SQLObject] Auto-relationship one-to-many
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2007-01-24 20:18:27
|
On Wed, Jan 24, 2007 at 04:04:07PM -0300, Leandro Melo de Sales wrote: > class Container(InheritableSQLObject): > container = ForeignKey('Container') > > 1: container1 = Container(title="the title") > > raise TypeError, "%s() did not get expected keyword argument %s" % > (self.__class__.__name__, col.name) > TypeError: Container() did not get expected keyword argument containerID You have defined a foreign key without a default hence Container asked you to provide one. Either provide one explicitly: 1: container1 = Container(title="the title", container=None) or define a default value for the column: class Container(InheritableSQLObject): container = ForeignKey('Container', default=None) Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |