introspection.py 文件源码

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

项目:LatinSounds_AppEnviaMail 作者: G3ek-aR 项目源码 文件源码
def get_field_type(self, data_type, description):
        # If it's a NUMBER with scale == 0, consider it an IntegerField
        if data_type == cx_Oracle.NUMBER:
            precision, scale = description[4:6]
            if scale == 0:
                if precision > 11:
                    return 'BigIntegerField'
                elif precision == 1:
                    return 'BooleanField'
                else:
                    return 'IntegerField'
            elif scale == -127:
                return 'FloatField'

        return super(DatabaseIntrospection, self).get_field_type(data_type, description)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号