Ejemplo n.º 1
0
 def get_all(self, environment="development"):
     d = self.db.mturkconnections.find()
     if d:
         for c in d:
             c['environment'] = environment
             mtconn = MTurkConnection.deserialize(c)
             yield mtconn
 def get_all(self, environment="development"):
     d = self.db.mturkconnections.find()
     if d :
         for c in d:
             c['environment']=environment
             mtconn = MTurkConnection.deserialize(c)
             yield mtconn
 def get_by_email(self, email=None, environment="development"):
     d = self.db.mturkconnections.find_one({'email' : email})
     if not d:
         return None
     else:
         d['environment']=environment
         return MTurkConnection.deserialize(d)
Ejemplo n.º 4
0
 def get_by_email(self, email=None, environment="development"):
     #d = self.db.mturkconnections.find_one({'email' : email})
     d = self.db.mturkconnections.find_one({})
     if not d:
         return None
     else:
         d['email'] = email
         d['environment'] = environment
         return MTurkConnection.deserialize(d)
Ejemplo n.º 5
0
 def create(self, d):
     mtconn = MTurkConnection(**d)
     self.update(mtconn)
     return mtconn