def look(request):
query = "a"
result1 = userinfo.objects.filter(name__contains=query)
result2 = department.objects.filter(name__contains=query)
res_list = list(chain(result1,result2))
print(res_list)
return HttpResponse("成功")
将多个模型类的搜索结果合并输出
最新推荐文章于 2024-08-23 16:53:34 发布