当前位置:Gxlcms > 数据库问题 > ORM执行原生SQL语句

ORM执行原生SQL语句

时间:2021-07-01 10:21:17 帮助过:3人阅读

django.db import connection, connections cursor = connection.cursor() # cursor = connections[‘default‘].cursor() cursor.execute("""SELECT * from auth_user where id = %s""", [1]) ret = cursor.fetchone()

有点像pymysql

 

ORM执行原生SQL语句

标签:cti   HERE   code   color   bsp   connect   nbsp   port   sele   

人气教程排行