Hi,

I have a model class which contains a nullable DateTime column, and its 
default value is now().  Its value is None immediately after it’s 
instantiated with Model(col=None), but it becomes filled to the current 
time after the session gets flushed.  (Note: I’m using 
sqlalchemy.ext.declarative with its default constructor.)  Does defaultvalue 
mean just alternative value to 
None?

I want to make the column to be set to the current time by default, but 
still possible to be explicitly set to None if needed.  Is there any way to 
achieve this?


Thanks,
Hong Minhee

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/m93YnzBU_tUJ.
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.

Reply via email to