[sqlalchemy] default value from column

2011-07-13 Thread ddarko
class AccountHistory(Base): id = sa.Column(sa.types.Integer, primary_key=1) date= sa.Column(sa.types.DateTime, nullable=0, default=sa.func.current_timestamp()) type= sa.Column(sa.types.Integer, nullable=0,

Re: [sqlalchemy] default value from column

2011-07-13 Thread Will Weaver
I'm not positive about this but if you are talking about the integer column, all defaults have to be a string or some SQLAlchemy function so you'd want: type = sa.Column(sa.types.Integer, nullable=0, default='1') On Wed, Jul 13, 2011 at 7:37 AM, ddarko ddarko...@gmail.com wrote: class