Пример #1
0
 def on_get(self, req, res, id):
     session = req.context['session']
     try:
         data = Vendors.find_one(session, id)
         self.on_success(res, data.to_dict())
     except NoResultFound:
         raise DataNotFound()
Пример #2
0
 def on_delete(self, req, res, id):
     session = req.context['session']
     try:
         Vendors.find_delete(session, id)
         self.on_success(res, None)
     except NoResultFound:
         raise DataNotFound()