示例#1
0
文件: storage.py 项目: dmvieira/rpaas
 def store_plan(self, plan):
     plan.validate()
     d = plan.to_dict()
     d["_id"] = d["name"]
     del d["name"]
     try:
         self.db[self.plans_collection].insert(d)
     except pymongo.errors.DuplicateKeyError:
         raise DuplicateError(plan.name)
示例#2
0
文件: storage.py 项目: vfiebig/rpaas
 def store_plan(self, plan):
     plan.validate()
     d = plan.to_dict()
     d["_id"] = d["name"]
     del d["name"]
     try:
         self.db[self.plans_collection].insert(d)
     except pymongo.errors.DuplicateKeyError:
         raise DuplicateError(plan.name)