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, 
default=1)

    def getdefault(self, name):
        return self.....name....default ?

eg:
print(AccountHistory().getdefault('type'))
1


I would like to write a function that returns a default value defined
for that column in the table.
How does it make?

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to