From: Hong Y. <ob...@21...> - 2004-12-24 09:34:16
|
Hi, I have a field in a PostgreSQL database table for which I would like the database to calculate the default value. The field itself is declared as NOT NULL DEFAULT (some function) When defining the SQLObject class, if I use field = Col() and then try to create an item I get the error that the field must have a value. If I use instead: field = Col(default=None) I am not required to give a value but it is translated into INSERT ... SET FIELD VALUE NULL, which is not allowed by the table definition. How can I make SQLObject create an INSERT statement without the field 'FIELD' so that the database will take over the calculation of the default value? It wouldn't make sense to duplicate the database logic of default value calculation in Python to be used in Col(default = ...) Your help is appreciated. Hong Yuan |