(self, method, func)
| 254 | self[method] = self.action.__name__ |
| 255 | |
| 256 | def _map(self, method, func): |
| 257 | assert method not in self, ( |
| 258 | "Method '%s' has already been mapped to '.%s'." % (method, self[method])) |
| 259 | assert func.__name__ != self.action.__name__, ( |
| 260 | "Method mapping does not behave like the property decorator. You " |
| 261 | "cannot use the same method name for each mapping declaration.") |
| 262 | |
| 263 | self[method] = func.__name__ |
| 264 | |
| 265 | return func |
| 266 | |
| 267 | def get(self, func): |
| 268 | return self._map('get', func) |