Пример #1
0
 def update_item(self, item_id):
     coll = self.mongo.db[self.name]
     coll.save(json_load(request.data))
     return jsonify({'message': 'OK'})
Пример #2
0
 def create_item(self):
     coll = self.mongo.db[self.name]
     item = json_load(request.data)
     coll.save(item)
     return jsonify(item)