【发布时间】:2013-03-03 04:32:46
【问题描述】:
cursor = connection.cursor()
cursor.execute("UPDATE public.rsvp SET status=TRUE WHERE rsvp_id=%s", [rsvp_id])
cursor.execute("SELECT status, rsvp_id FROM public.rsvp WHERE rsvp_id=%s", [rsvp_id])
row = cursor.fetchall()
当我在我的 Django 项目中执行此操作时,我得到了我期望看到的返回的行,但后来当我为同一行选择查询时,它显示为该语句从未真正运行过。在我的代码中,“状态”列默认为 NULL。运行后,我的表中仍然看到 NULL。
【问题讨论】:
标签: python sql django postgresql