When specifying selection criteria using field-value pair parameters, these qualifiers can be applied to field values to filter results.
See QuerySet API reference - Field lookups for a detailed description of each qualifier in the Django documentation.
<field>__<qualifier>=<value>
Note: There are two underscore characters between the field and qualifier names.
Important: The datatype of the specified value(s) must match the expected field datatype.
exact | iexact | contains | icontains |
in | gt | gte | lt |
lte | startswith | istartswith | endswith |
iendswith | range | year | month |
day | week_day | isnull | search |
regex | iregex | – | – |
Return element(s) whose value for the specified field is an exact match (case-sensitive). Example:
library__exact=E_coli_dh10b
Return element(s) whose value for the specified field is an exact match (case-insensitive). Example:
library__iexact=E_coli_dh10b
Return element(s) whose value for the specified field contains the specified value (case-sensitive). (See also search.) Example:
library__contains=E_coli
Return element(s) whose value for the specified field contains the specified value (case-insensitive). Example:
library__icontains=E_coli
Return element(s) whose value for the specified field is in the specified list. Example:
id__in=[1, 3, 4]
Return element(s) whose value for the specified field is greater than the specified value. Example:
name__gt=B4
Return element(s) whose value for the specified field is greater than or equal to the specified value. Example:
name__gte=B4
Return element(s) whose value for the specified field is less than the specified value. Example:
name__lt=B24
Return element(s) whose value for the specified field is less than or equal to the specified value. Example:
name__lte=B24
Return element(s) whose value for the specified field starts with the specified value (case-sensitive). Example:
library__startswith=E_coli
Return element(s) whose value for the specified field starts with the specified value (case-insensitive). Example:
library__istartswith=E_coli
Return element(s) whose value for the specified field ends with the specified value (case-sensitive). Example:
library__endswith=dh10b
Return element(s) whose value for the specified field ends with the specified value (case-insensitive). Example:
library__iendswith=dh10b
Return element(s) whose value for the specified field is in the range of the specified values (inclusive). Example:
date__range=(start_date, end_date))
Return element(s) whose value for the specified date/datetime field matches the specified year. Example:
date__year=2013
Return element(s) whose value for the specified date/datetime field matches the specified integer month. Example:
date__month=6
Return element(s) whose value for the specified date/datetime field matches the specified integer day-of-month. Example:
date__day=17
Return element(s) whose value for the specified date/datetime field matches the specified integer day-of-week, where Sunday = 1 and Saturday = 7. Example:
date__week_day=2
Return element(s) whose value for the specified field is NULL, where True = NULL and False = NOT NULL. Example:
date__isnull=True
Return element(s) whose value for the specified field contains the specified value. (See also contains.) Example:
comment__search="my test results"
Return element(s) whose value for the specified field matches the regular expression (case-sensitive). Example:
name__regex=r'^(An?|The) +'
Return element(s) whose value for the specified field matches the regular expression (case-insensitive). Example:
name__iregex=r'^(an?|the) +'