23👍
✅
It’s a case-insensitive containment test.
Example:
Entry.objects.get(headline__icontains='Lennon')
SQL equivalent:
SELECT ... WHERE headline ILIKE '%Lennon%';
In your case the code says maps should be True
if either the name or the description field contains the value of search_terms
.
3👍
xxx_icontains
searches the whole xxx
field for the argument, case-insensitively.
http://docs.djangoproject.com/en/1.1/ref/models/querysets/#icontains
- Test Django REST Framework Login Protected API using Postman?
- Disable caching for a view or url in django
Source:stackexchange.com