Hi,
we ran into a small problem today, related to default values for
table's columns. Here an example :
test = Table('test', metadata,
Column('id', Integer, primary_key=True),
Column('test_value', Boolean, default=False, nullable=False)
)
class Test(object):pass
test_mapper = mapper(Test, test)
metadata is a bound metadata connected on a PostgreSQL (8.1) database.
The problem is that creating a new object from class Test doesn't set
the default value for attributes :
>>> t = Test()
>>> print t.test_value
None
(However, the default value is used just before inserting the object
in the database, which is fine).
Is there an easy way to have attributes set to there default values,
instead of None ?
Thanks,
- Jonathan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---