codegen.py 文件源码

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

项目:sqlacodegen 作者: agronholm 项目源码 文件源码
def __init__(self, table):
        super(Model, self).__init__()
        self.table = table
        self.schema = table.schema

        # Adapt column types to the most reasonable generic types (ie. VARCHAR -> String)
        for column in table.columns:
            cls = column.type.__class__
            for supercls in cls.__mro__:
                if hasattr(supercls, '__visit_name__'):
                    cls = supercls
                if supercls.__name__ != supercls.__name__.upper() and not supercls.__name__.startswith('_'):
                    break

            column.type = column.type.adapt(cls)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号