Each Answer to this Q is separated by one/two green lines.
How can I use
iexact Field lookups at the same query in Django?
Like that ..
casas = Casa.objects.filter(nome_fantasia__contains__iexact="green")
If you need case-insensitive
casas = Casa.objects.filter(nome_fantasia__icontains="green")
Which is converted to
... WHERE nome_fantasia ILIKE '%green%'
Honestly, you don’t need to. The two resultsets overlap. If you were intending
AND then just use the most restrictive:
__iexact. if you want
Just to answer your question you could do something like below (note this is an
casas = Casa.objects.filter(nome_fantasia__contains="green", nome_fantasia__iexact="green")