[SQLObject] How to insert a boolean into PostgreSQL
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: CLIFFORD I. <cli...@di...> - 2004-02-20 07:35:48
|
Hi, I was able to create a PostgreSQL table with a boolean column by doing myClass.createTable but I cannot insert into it without SQLObject raising the following error: ValueError: Unknown SQL builtin type: <type 'instance'> for TRUE I am attempting to insert as follows: p = person.new(firstName="Donald", lastName="Duck" , amtPaid="10.26", isParticipant=True) I tried assigning "", "T", 1 to isParticipant but all behaved the same way. NULLs are allowed for the boolean column. How can I insert into this table? Also, how would I specify a default value for a boolean column? I tried: isParticipant=BoolCol(default=True) and when I created the table, there was no default for the column. Regards, Clifford Ilkay Dinamis Corporation 3266 Yonge Street, Suite 1419 Toronto, Ontario Canada M4N 3P6 Tel: 416-410-3326 |