kvesteri/sqlalchemy-defaults — pull request #1 by FelixLoether (2013-07-29 14:29:18+00:00)
Title: Don't create server defaults from callable string defaults.

These changes make it possible to use a callable default value for strings. For example:

class User(Model):
default_color = Column(Unicode(7), default=u'#EE9966')

class Post(Model):
color = Column(Unicode(7), default=lambda: (
current_user.default_color if current_user else '#EE9966'
))

This doesn't work prior to the change because callables can't be used as values for server_default - in order to use a callable default one has to turn off string defaults for the entire model. After the change server_default isn't set for the columns with callable defaults, but is still set normally for other columns. The same approach is already used for integer columns.