我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用sqlalchemy.Time()。
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('event', sa.Column('finishTime', sa.Time(), nullable=True)) op.add_column('event', sa.Column('startTime', sa.Time(), nullable=True)) # ### end Alembic commands ###
def __str__(self): ''' Method for pretty printing ''' return '\n'.join(['Content: ' + str(self.content), 'Author: ' + str(self.author), 'Posting Date: ' + str(self.posting_date), 'To: ' + str(self.to), 'From: ' + str(self.frm), 'Time: ' + str(self.time), 'Date: ' + str(self.date), 'PostId: ' + str(self.post_id) ])
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('reviews', sa.Column('id', sa.Integer(), nullable=False), sa.Column('movie_id', sa.Integer(), nullable=True), sa.Column('movie_title', sa.String(), nullable=True), sa.Column('image_path', sa.String(), nullable=True), sa.Column('movie_review', sa.String(), nullable=True), sa.Column('posted', sa.Time(), nullable=True), sa.Column('user_id', sa.Integer(), nullable=True), sa.ForeignKeyConstraint(['user_id'], ['users.id'], ), sa.PrimaryKeyConstraint('id') ) # ### end Alembic commands ###