Permalink
Browse files

Fix QCombination import

  • Loading branch information...
1 parent ed82095 commit 64f60bae18cd1737a3b55a217551dcebde09bf91 @mattupstate committed Jun 3, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 flask_social/datastore.py
@@ -74,7 +74,10 @@ def __init__(self, db, connection_model):
ConnectionDatastore.__init__(self, connection_model)
def _query(self, **kwargs):
- from mongoengine.queryset import Q, QCombination
+ try:
+ from mongoengine.queryset import Q, QCombination
+ except ImportError:
+ from mongoengine.queryset.visitor import Q, QCombination
queries = map(lambda i: Q(**{i[0]: i[1]}), kwargs.items())
query = QCombination(QCombination.AND, queries)
return self.connection_model.objects(query)

0 comments on commit 64f60ba

Please sign in to comment.