Hi, >It is nice being able to default to some logic inside the database because >if there's access to it using some other tool or even directly through SQL >commands then the default would still be applied / applicable. > > In that case, I reckon using a database trigger will be best for this - it applies even when using raw SQL.
>But then you can't say that you have a NOT NULL column because if you omit >the value then you'll get an SQL error... (While you can say, for >example, "INSERT INTO table (column) VALUES (DEFAULT)" to get the default >value.) > > I'm pretty sure the before insert trigger is called before it does the constraint checks. Have a go at knocking up a test case to confirm this. Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
