On Wednesday, January 18, 2012 11:45:33 PM UTC-5, tsvim wrote: > > I think I got it, but I don't understand the solution. If I understand > correctly, since the model is run before the controller, default is set to > None. But why does lambda solve this? >
When you set the default to a callable (such as a lambda), it doesn't get evaluated until the actual insert is done. By the time the insert happens, session.table_token has already been created, so the lambda will return the token instead of None. Anthony

