The 'default' option for an SA Column is only used by the SA layer
when inserting data. It does not get passed to the actual database
schema. As sanjay says, you probably want to look at the
PassiveDefault option.
http://www.sqlalchemy.org/docs/metadata.html#metadata_defaults_passive
Cheers
CM
On 23 Jun 2007, at 06:54, Todd Martin wrote:
>
> I'm not sure if this is intentional behavior, but when I run "tg-admin
> sql create" the column default settings are not being added to the
> table.
>
> I define a column like this...
>
> Column("bookmark", Boolean, default=False, index=True),
>
> If the Turbogears program was the only program to insert into the
> database this wouldn't be a problem because any rows inserted through
> Turbogears and SQLAlchemy get the default value. However, if I try to
> insert a row into the same table via a C++ program no defaults are
> applied.
>
> It seems that the reason for this is because the CREATE TABLE command
> doesn't add the default attribute for the column.
>
> Any idea if this is a bug or intentional?
>
> Thanks,
>
> Todd
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---