From c84f703f926c2e37095c0703d884b2dc5a06b7e6 Mon Sep 17 00:00:00 2001 From: George Karakostas Date: Thu, 22 Dec 2016 20:06:55 +0200 Subject: [PATCH] Update documentation to include a Q import (#1441) --- docs/guide/querying.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/guide/querying.rst b/docs/guide/querying.rst index 913de5d6..980947df 100644 --- a/docs/guide/querying.rst +++ b/docs/guide/querying.rst @@ -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 calling it with keyword arguments:: + from mongoengine.queryset.visitor import Q + # Get published posts Post.objects(Q(published=True) | Q(publish_date__lte=datetime.now()))