It worked, thanks a lot! It's in the documentation, I just never
thought it would work... :)
default: The default value for this column. Used when creating a new
row. If you give a callable object or function, the function will be
called, and the return value will be used. (...)
João Paulo Fernandes Farias wrote:
> I did not tested, but I think you should use datetime.today, without
> the parentheses.
> Try it.
> On 9/6/05, *Humberto Diogenes* <adm.humberto@...
> <mailto:adm.humberto@...>> wrote:
> My system is running fine with SQLObject 0.6, but when I try to
> run it
> with 0.6.1 or 0.7b1 I get this error:
> Invalid: expected a datetime in the DateTimeCol 'data_cadastro', got
> <type 'str'> instead
> I know it is because I'm using 'now()' as the default value. The
> problem is that when I change it to datetime.today() everything starts
> to be recorded with the same date. This happens because the class
> definitions are in a different module and ModPython caches imports
> (datetime.today gets cached and isn't updated until Apache restarts).
> I know this cache isn't a problem with SQLObject itself, but I
> upgrade to 0.6.1 because of its datetime restrictions... AFAIK I can't
> disable ModPython's import cache, do you have any suggestions?
Esta mensagem foi verificada pelo sistema de anti-virus e
acredita-se estar livre de perigo.