peewee_moves.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:peewee-moves 作者: timster 项目源码 文件源码
def add_column(self, table, name, coltype, **kwargs):
        """
        Add the given column to the given table.

        :param table: Table name to add column to.
        :param name: Name of the column field to add.
        :param coltype: Column type (from FIELD_TO_PEEWEE).
        :param kwargs: Arguments for the given column type.
        :return: None
        """
        field_class = FIELD_TO_PEEWEE.get(coltype, peewee.CharField)
        self.migrator.add_column(table, name, field_class(**kwargs)).run()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号