def post(self): print('params', self.params) if self.params.a != 1: raise params.InvalidParams('a != 1') if self.params.b and self.params.b != 'b': raise params.InvalidParams('b != b') return self.write(str(self.params))
def get(self, mac): try: mac_field.validate(mac) except ValueError as e: raise params.InvalidParams('invalid mac: {}'.format(e)) print mac self.write(mac)
def get(self): print('params', self.params) if self.params.a != 1: raise params.InvalidParams('a != 1') return self.write(str(self.params))
def post(self): print('params', self.params) if 'a' not in self.params: raise params.InvalidParams('no a') return self.write(str(self.params))