Ejemplo n.º 1
0
Archivo: store.py Proyecto: catlee/lwr
    def getPlan(self, _id):
        p = self.col.find_one({"_id": ObjectId(_id)})
        if not p:
            raise KeyError("Plan %s not found" % _id)

        p = from_mongo_id(p)
        return Plan.fromDict(p)
Ejemplo n.º 2
0
Archivo: store.py Proyecto: catlee/lwr
 def findPlansByEventType(self, event_type):
     retval = []
     plans = self.col.find({"events": event_type})
     for p in plans:
         p = from_mongo_id(p)
         p = Plan.fromDict(p)
         retval.append(p)
     return retval
Ejemplo n.º 3
0
Archivo: store.py Proyecto: catlee/lwr
 def findPlansByBucket(self, bucket):
     retval = []
     plans = self.col.find({"bucket": bucket})
     for p in plans:
         p = from_mongo_id(p)
         p = Plan.fromDict(p)
         retval.append(p)
     return retval