Paul Johnston wrote:

> 
> Hi,
> 
>>generate the default values (default = _some_python_function_). The
>>problem is that such function is not saved in the database itsself.
>>
> Ok, I wonder, why is this a problem for you? Usually people are happy
> with ORM-specific logic (such as this) just being stored in a python
> module and not the database.

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.

> One other possibility is to code the default inside a database trigger.

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.)


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to