【发布时间】:2020-04-18 18:46:40
【问题描述】:
select *from table_name where name = %s",params={"name1","name2"}
完整代码:
from django.shortcuts import render
from . models import destination
def index(request,params = None):
dests1 = destination.objects.raw("select *from travello_destination where name = %s",params={'Bangalore','Mumbai'})
return render(request,'index.html', {"dests":dests1})
【问题讨论】: