条件を取得するためのループを作成しました。
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」句に追加する方法はありますか?