Django Tutorial · Django References

Field lookups Reference

Learn all about Field lookups Reference in this comprehensive tutorial.

5 min read intermediate
  • A list of all field look up keywords:

Field Lookups Reference

A list of all field look up keywords:

KeywordDescription
containsContains the phrase
icontainsSame as contains, but case-insensitive
dateMatches a date
dayMatches a date (day of month, 1-31) (for dates)
endswithEnds with
iendswithSame as endswidth, but case-insensitive
exactAn exact match
iexactSame as exact, but case-insensitive
inMatches one of the values
isnullMatches NULL values
gtGreater than
gteGreater than, or equal to
hourMatches an hour (for datetimes)
ltLess than
lteLess than, or equal to
minuteMatches a minute (for datetimes)
monthMatches a month (for dates)
quarterMatches a quarter of the year (1-4) (for dates)
rangeMatch between
regexMatches a regular expression
iregexSame as regex, but case-insensitive
secondMatches a second (for datetimes)
startswithStarts with
istartswithSame as startswith, but case-insensitive
timeMatches a time (for datetimes)
weekMatches a week number (1-53) (for dates)
week_dayMatches a day of week (1-7) 1 is Sunday
iso_week_dayMatches a ISO 8601 day of week (1-7) 1 is Monday
yearMatches a year (for dates)
iso_yearMatches an ISO 8601 year (for dates)

Module quiz

2 questions
1

Which of the following is true about Field lookups Reference?

2

What is the most common pitfall when working with Field lookups Reference?

Answer all questions to submit.