__exact 精确等于 like 'aaa'

 __iexact 精确等于 忽略大小写 ilike 'aaa'
 __contains 包含 like '%aaa%'
 __icontains 包含 忽略大小写 ilike '%aaa%',但是对于sqlite来说,contains的作用效果等同于icontains。
__gt 大于
__gte 大于等于
__lt 小于
__lte 小于等于
__in 存在于一个list范围内
__startswith 以...开头
__istartswith 以...开头 忽略大小写
__endswith 以...结尾
__iendswith 以...结尾,忽略大小写
__range 在...范围内
__year 日期字段的年份
__month 日期字段的月份
__day 日期字段的日
__isnull=True/False

 

手册地址:

https://docs.djangoproject.com/en/2.0/ref/models/querysets/#field-lookups

相关文章:

  • 2021-05-08
  • 2017-12-19
  • 2022-01-17
  • 2021-10-02
  • 2021-11-11
  • 2022-12-23
  • 2022-02-07
猜你喜欢
  • 2022-02-21
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
相关资源
相似解决方案