Python sqlalchemy 模块,DATE 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用sqlalchemy.DATE

项目:conditional    作者:ComputerScienceHouse    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('housing_evals',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('uid', sa.VARCHAR(length=32), nullable=False),
    sa.Column('social_attended', sa.TEXT(), nullable=False),
    sa.Column('social_hosted', sa.TEXT(), nullable=False),
    sa.Column('technical_attended', sa.TEXT(), nullable=False),
    sa.Column('technical_hosted', sa.TEXT(), nullable=False),
    sa.Column('projects', sa.TEXT(), nullable=False),
    sa.Column('comments', sa.TEXT(), nullable=False),
    sa.Column('points', sa.INTEGER(), nullable=False),
    sa.Column('active', sa.BOOLEAN(), nullable=False),
    sa.Column('date_created', sa.DATE(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###
项目:pyiem    作者:rheineke    | 项目源码 | 文件源码
def bundles_table(metadata):
    mkt_id_fk = sa.ForeignKey(MARKETS + '.' + ID)
    return sa.Table(
        BUNDLES,
        metadata,
        sa.Column(ID, sa.INTEGER, primary_key=True, nullable=False),
        sa.Column(MARKET_ID, sa.INTEGER, mkt_id_fk, nullable=False),
        sa.Column(OPEN_DATE, sa.DATE, nullable=False),
        sa.Column(EXPIRY_DATE, sa.DATE, nullable=False),
        sa.Column(LIQUIDATION_DATE, sa.DATE, nullable=True),
    )