示例#1
0
 def _register_endpoints(self):
     """Manually call the decorator function to register the generated CRUD methods."""
     hug.call(accept=['post'],
              urls=["/{0}".format(self.base)],
              parameters=self.fields
              )(self.create)
     hug.call(accept=['get'],
              urls=["/{0}".format(self.base), "/{0}/{{{1}}}".format(self.base, self.pk_n)],
              parameters=self.pk,
              defaults=self.pk_d,
              )(self.read_skeleton)
     hug.call(accept=['put'],
              urls=["/{0}".format(self.base), "/{0}/{{{1}}}".format(self.base, self.pk_n)],
              parameters=self.all,
              defaults=self.fields_d,
              )(self.update)
     hug.call(accept=['delete'],
              urls=["/{0}".format(self.base), "/{0}/{{{1}}}".format(self.base, self.pk_n)],
              parameters=self.pk
              )(self.delete)
示例#2
0
 def __init__(self):
     hug.call()(self.hello_world_method)
示例#3
0
 def __init__(self):
     hug.call()(self.hello_world_method)