之间的区别是什么
books = Book.objects.filter(name__in=names,film__isnull=True)
books = books.union(Book.objects.filter(name__in=names,film__date__lte=date)).distinct("id")
VS
from django.db.models import Q
books = Book.objects.filter(Q(name__in=names),Q(film__date__lte=date)| Q(film__isnull=True)).distinct(id)
和之间的区别是什么?
[...].filter(
Q(hide=False) & Q(deleted=False),
Q(stock=False) | Q(quantity__gte=1))
VS
[...].filter(
Q(hide=False),Q(deleted=False),
Q(stock=False) | Q(quantity__gte=1))
thx