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