【发布时间】:2021-10-09 17:38:39
【问题描述】:
我怎样才能只获得以下查询的值。我只想获取 name 的值,而不是 dict,因为在 laravel 中您可以使用我可以使用的 django 中的 -> get ()。
with connection.cursor() as cursor:
cursor.execute("SELECT name FROM person WHERE id=2")
fila=cursor.fetchall()
谢谢。
【问题讨论】:
标签: python html sql django django-models