Tutorials References Exercises Videos Menu
Website Get Certified Pro NEW

Field Lookups - iexact


Example

Get all records where firstname is exactly "emil":

mydata = Members.objects.filter(firstname__iexact='emil').values()
Run Example »

Definition and Usage

The iexact lookup is used to get records with a specified value.

The iexact lookup is case insensitive.

For a case sensitive search, use the exact lookup.


SQL Equivalent

The SQL equivalent to the example above will be:

WHERE firstname = 'emil';

Syntax

All Field lookup keywords must be specified with the fieldname, followed by two(!) underscore characters __ and the keyword:

fieldname__iexact='value'