Hong Minhee
unread,Dec 13, 2012, 12:41:38 PM12/13/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlal...@googlegroups.com
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 default value 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