Hi,

Is there a way in SQLalchemy to have the values of a mapped reflected
table object set to default column values derived from the database
backend?

e.g.  if column 'bar' of table 'foo' in my database has a default of
"True", I would like to be able to do the following:

>>> foo_table = Table("foo", metadata, autoload=True, autoload_with=engine)
>>> mapper(Foo, foo_table)
>>> f = Foo()
>>> f.bar
True

Instead f.bar is None.

Is there an elegant way to achieve this without querying
information_schema and setting the defaults from there?

Jamie

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to