addons14/base_rest/models/rest_service_registration.py
def _generate_methods(self):
        """Generate controller's methods and associated routes

        This method inspect the service definition and generate the appropriate
        methods and routing rules for all the methods decorated with @restappi.method
        :return: A dictionary of method name : method
        """
        methods = {}
        _globals = {}
        root_path = self._base_controller._root_path
        path_sep = ""
        if root_path[-1] != "/":
            path_sep = "/"
        root_path = "{}{}{}".format(root_path, path_sep, self._service._usage)
        for name, method in _inspect_methods(self._service.__class__):
            if not hasattr(method, "routing"):
                continue
            routing = method.routing
            for routes, http_method in routing["routes"]:
                method_name = "{}_{}".format(http_method.lower(), name)
                default_route = routes[0]
                rule = Rule(default_route)
                Map(rules=[rule])
                if rule.arguments:
                    method = METHOD_TMPL_WITH_ARGS.format(
                        method_name=method_name,
                        service_name=self._service_name,
                        service_method_name=name,
                        args=", ".join(rule.arguments),
                    )
                else:
                    method = METHOD_TMPL.format(
                        method_name=method_name,
                        service_name=self._service_name,
                        service_method_name=name,
                    )
                exec(method, _globals)
                method_exec = _globals[method_name]
                method_exec = http.route(
                    ["{}{}".format(root_path, r) for r in routes],
                    methods=[http_method],
                    auth=routing["auth"],
                    cors=routing["cors"],
                    csrf=routing["csrf"],
                )(method_exec)
                methods[method_name] = method_exec
        return methods
Generate controller's methods and associated routes

        This method inspect the service definition and generate the appropriate
        methods and routing rules for all the methods decorated with @restappi.method
        :return: A dictionary of method name : method
        
Generate controller's methods and associated routes
This method inspect the service definition and generate the appropriate
methods and routing rules for all the methods decorated with @restappi.method
Generate controller ' s methods and associated routes This method inspect the service definition and generate the appropriate methods and routing rules for all the methods decorated with @restappi . method
def _generate_methods(self):
        methods = {}
        _globals = {}
        root_path = self._base_controller._root_path
        path_sep = ""
        if root_path[-1] != "/":
            path_sep = "/"
        root_path = "{}{}{}".format(root_path, path_sep, self._service._usage)
        for name, method in _inspect_methods(self._service.__class__):
            if not hasattr(method, "routing"):
                continue
            routing = method.routing
            for routes, http_method in routing["routes"]:
                method_name = "{}_{}".format(http_method.lower(), name)
                default_route = routes[0]
                rule = Rule(default_route)
                Map(rules=[rule])
                if rule.arguments:
                    method = METHOD_TMPL_WITH_ARGS.format(
                        method_name=method_name,
                        service_name=self._service_name,
                        service_method_name=name,
                        args=", ".join(rule.arguments),
                    )
                else:
                    method = METHOD_TMPL.format(
                        method_name=method_name,
                        service_name=self._service_name,
                        service_method_name=name,
                    )
                exec(method, _globals)
                method_exec = _globals[method_name]
                method_exec = http.route(
                    ["{}{}".format(root_path, r) for r in routes],
                    methods=[http_method],
                    auth=routing["auth"],
                    cors=routing["cors"],
                    csrf=routing["csrf"],
                )(method_exec)
                methods[method_name] = method_exec
        return methods
def _generate_methods ( self ) : methods = { } _globals = { } root_path = self . _base_controller . _root_path path_sep = "" if root_path [ - 1 ] != "/" : path_sep = "/" root_path = "{}{}{}" . format ( root_path , path_sep , self . _service . _usage ) for name , method in _inspect_methods ( self . _service . __class__ ) : if not hasattr ( method , "routing" ) : continue routing = method . routing for routes , http_method in routing [ "routes" ] : method_name = "{}_{}" . format ( http_method . lower ( ) , name ) default_route = routes [ 0 ] rule = Rule ( default_route ) Map ( rules = [ rule ] ) if rule . arguments : method = METHOD_TMPL_WITH_ARGS . format ( method_name = method_name , service_name = self . _service_name , service_method_name = name , args = ", " . join ( rule . arguments ) , ) else : method = METHOD_TMPL . format ( method_name = method_name , service_name = self . _service_name , service_method_name = name , ) exec ( method , _globals ) method_exec = _globals [ method_name ] method_exec = http . route ( [ "{}{}" . format ( root_path , r ) for r in routes ] , methods = [ http_method ] , auth = routing [ "auth" ] , cors = routing [ "cors" ] , csrf = routing [ "csrf" ] , ) ( method_exec ) methods [ method_name ] = method_exec return methods
Generate controller's methods and associated routes
This method inspect the service definition and generate the appropriate
methods and routing rules for all the methods decorated with @restappi.method
Generate controller ' s methods and associated routes This method inspect the service definition and generate the appropriate methods and routing rules for all the methods decorated with @restappi . method
"""Generate controller's methods and associated routes

        This method inspect the service definition and generate the appropriate
        methods and routing rules for all the methods decorated with @restappi.method
        :return: A dictionary of method name : method
        """
A dictionary of method name : method
A dictionary of method name : method
self