base.py 文件源码

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

项目:pyetje 作者: rorlika 项目源码 文件源码
def visit_primary_key_constraint(self, constraint):
        # for columns with sqlite_autoincrement=True,
        # the PRIMARY KEY constraint can only be inline
        # with the column itself.
        if len(constraint.columns) == 1:
            c = list(constraint)[0]
            if c.primary_key and \
                c.table.kwargs.get('sqlite_autoincrement', False) and \
                issubclass(c.type._type_affinity, sqltypes.Integer) and \
                not c.foreign_keys:
                return None

        return super(SQLiteDDLCompiler, self).\
                    visit_primary_key_constraint(constraint)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号