Field lookups are how we specify the conditions in the
WHERE clause of an SQL. They are specified as keyword arguments for QuerySet methodslike
As a convenience when no lookup type is provided (like in
Entry.objects.get(id=10)) the lookup type is assumed to be exact.
exact is used for exact match of the string with value in the field. match. If the value provided for comparison is None, it will be interpreted as an SQL NULL.
SELECT * from entry WHERE id = 14; SELECT * from entry WHERE id IS NULL;
iexact looks for the exact string, but case-insensitive match. If the value provided for comparison is None, it will be interpreted as an SQL NULL, similar to exact.
Entry.objects.get(name__iexact='atemon entry') Entry.objects.get(name__iexact=None)
SELECT * from entry WHERE name ILIKE 'atemon entry'; SELECT * from entry WHERE name IS NULL;
The first query will match "ATEMON Entry", "Atemon Entry", "AtEMon ENtry" etc