Django ORM操作

Page content
简述djangoOrm过滤查询常用操作符。
模糊匹配
__exact
like ‘a’__iexact
忽略大小写 ilike ‘a’__contains
like ‘%a%’__icontains
忽略大小写 ilike ‘%a%’
比较
__gt
大于__gte
大于等于__lt
小于__lte
小于等于__in
成员对象判断
查询
__startswith
开头判断__istartswith
开头判断 忽略大小写__endswith
结尾判断__iendswith
结尾判断,忽略大小写__range
范围判断
时间
__year
日期年份__month
日期月份__day
日期某天
布尔类型
__isnull=True/False
__isnull=True
与__exact=None
的区别