On 30 juil, 19:36, Michael Bayer <[EMAIL PROTECTED]> wrote:
> Cant reproduce. Heres a test script which runs fine for me with PG 8.1:
>
> from sqlalchemy import *
>
> metadata = MetaData('postgres://scott:[EMAIL PROTECTED]/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() ?
No, after a flush(), everything is fine.
However, I would like to have the default value _before_ flush()-ing.
Hmm, after thinking about it a few more minutes, it would be a bit
restrictive, since it will work only for 'scalar' values :/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---