Example #1
0
 def get(self, id=None):
     # TODO: add case-insensitive lookup
     if id:
         data = self._get_trial(id)
     else:
         data = self._get_trials(limit=request.args.get('limit', 50),\
             skip=request.args.get('offset', 0))
     return bson_to_json(data)
Example #2
0
 def get(self, obj_id):
     result = db.equipment.find_one({"_id": ObjectId(obj_id)})
     if result is None:
         return result
     return utils.bson_to_json(json.loads(dumps(result)))
Example #3
0
 def get(self, id=None):
     if id:
         data = mongo.db.records.find_one({'r_id': id})
     else:
         data = {}
     return bson_to_json(data)
Example #4
0
 def get(self, obj_id):
     result = db.equipment_type.find_one({"_id": ObjectId(obj_id)})
     if result is None:
         return result
     return utils.bson_to_json(result)