我做了一个循环来检索条件:
for level in levels:
requete += ' and level_concat like %'+level+'%'
我在我的查询中提出:
countries = Country.objects.extra(where=['continent_id = "'+continent_id+'"', requete])
我试图在 where 子句中添加条件,但返回错误:
not enough arguments for format string
尊重的结果:
SELECT * FROM `Country` WHERE country_id = "US-51" AND level_concat LIKE %level_test%
有没有办法添加requete
到我的“where”子句中?