从Django数组中获取特定值

2024-09-30 12:35:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我用这个代码从表中取出id

        getItemid=cursor.execute("Select id from shop_carthistory where order_id =%s",[order.order_number])
    row=cursor.fetchall()
    context = {order_id": row }


{{order_id}} gives => ((37L,),) 

我只需要37个


Tags: 代码fromidnumberexecutecontextordershop

热门问题