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()
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()