def _get_converters(self):
return {'model': ModelConverter, 'models': ModelsConverter}
- def _find_handler(self):
- return self.routing_map().bind_to_environ(request.httprequest.environ).match()
+ def _find_handler(self, return_rule=False):
+ return self.routing_map().bind_to_environ(request.httprequest.environ).match(return_rule=return_rule)
def _auth_method_user(self):
request.uid = request.session.uid
def _dispatch(self):
# locate the controller method
try:
- func, arguments = self._find_handler()
+ rule, arguments = self._find_handler(return_rule=True)
+ func = rule.endpoint
except werkzeug.exceptions.NotFound, e:
return self._handle_exception(e)
convert_exception_to(
werkzeug.exceptions.Forbidden))
- processing = self._postprocess_args(arguments)
+ processing = self._postprocess_args(arguments, rule)
if processing:
return processing
return result
- def _postprocess_args(self, arguments):
+ def _postprocess_args(self, arguments, rule):
""" post process arg to set uid on browse records """
for arg in arguments.itervalues():
if isinstance(arg, orm.browse_record) and arg._uid is UID_PLACEHOLDER: