Permalink
Browse files

Import within _query function in case someone is not using MongoEngine

  • Loading branch information...
1 parent 0720259 commit a26ca32b8feee69b9e5acaadaae83fd603d026cb @mattupstate committed Apr 4, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 flask_social/datastore.py
@@ -10,7 +10,6 @@
"""
from flask_security.datastore import SQLAlchemyDatastore, MongoEngineDatastore
-from mongoengine.queryset import Q, QCombination
class ConnectionDatastore(object):
@@ -74,6 +73,7 @@ def __init__(self, db, connection_model):
ConnectionDatastore.__init__(self, connection_model)
def _query(self, **kwargs):
+ from mongoengine.queryset import Q, QCombination
queries = map(lambda i: Q(**{i[0]: i[1]}), kwargs.items())
return self.connection_model.objects(QCombination(QCombination.AND, queries))

0 comments on commit a26ca32

Please sign in to comment.