test_field.py 文件源码

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

项目:django-postgres-composite-types 作者: danni 项目源码 文件源码
def does_type_exist(self, type_name):
        """
        Check if a composite type exists in the database
        """
        sql = 'select exists (select 1 from pg_type where typname = %s);'
        with connection.cursor() as cursor:
            cursor.execute(sql, [type_name])
            row = cursor.fetchone()
            return row[0]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号