示例#1
0
文件: store.py 项目: 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)
示例#2
0
文件: store.py 项目: 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
示例#3
0
文件: store.py 项目: 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