11 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: Default value for ob...
FromSent OnAttachments
Jonathan Ballet30 Jul 2007 08:50 
Michael Bayer30 Jul 2007 10:36 
Jonathan Ballet30 Jul 2007 11:26 
sdob...@sistechnology.com30 Jul 2007 12:15 
Michael Bayer30 Jul 2007 13:33 
Paul Johnston30 Jul 2007 16:29 
Jonathan Ballet31 Jul 2007 01:11 
Michael Bayer31 Jul 2007 07:35 
Paul Johnston31 Jul 2007 08:30 
Michael Bayer31 Jul 2007 09:26 
Paul Johnston01 Aug 2007 13:23 
Subject:[sqlalchemy] Re: Default value for objects' attributes
From:Michael Bayer (mike@zzzcomputing.com)
Date:07/30/2007 10:36:17 AM
List:com.googlegroups.sqlalchemy

Cant reproduce. Heres a test script which runs fine for me with PG 8.1:

from sqlalchemy import *

metadata = MetaData('postgres://scott:tiger@127.0.0.1/test')

test = Table('test', metadata, Column('id', Integer, primary_key=True), Column('test_value', Boolean, default=False, nullable=False) ) metadata.create_all()

class Test(object):pass test_mapper = mapper(Test, test)

t = Test() sess = create_session() sess.save(t) sess.flush()

print t.test_value

did you forget to flush() ?