Update documentation to include a Q import (#1441)

This commit is contained in:
George Karakostas 2016-12-22 20:06:55 +02:00 committed by Stefan Wójcik
parent 57c2e867d8
commit c84f703f92

View File

@ -479,6 +479,8 @@ operators. To use a :class:`~mongoengine.queryset.Q` object, pass it in as the
first positional argument to :attr:`Document.objects` when you filter it by first positional argument to :attr:`Document.objects` when you filter it by
calling it with keyword arguments:: calling it with keyword arguments::
from mongoengine.queryset.visitor import Q
# Get published posts # Get published posts
Post.objects(Q(published=True) | Q(publish_date__lte=datetime.now())) Post.objects(Q(published=True) | Q(publish_date__lte=datetime.now()))