コード例 #1
0
ファイル: test_routing.py プロジェクト: jonparrott/Ferris2
    def testNameFromParts(self):

        self.assertEquals(routing.name_from_canonical_parts(None, "one", "two", []), "one:two")

        self.assertEquals(routing.name_from_canonical_parts("pre", "one", "two", []), "pre:one:two")

        self.assertEquals(routing.name_from_canonical_parts(None, "one", "two", ["x", "y"]), "one:two")

        self.assertEquals(routing.name_from_canonical_parts("pre", "one", "two", ["x", "y"]), "pre:one:two")
コード例 #2
0
    def testNameFromParts(self):

        self.assertEquals(
            routing.name_from_canonical_parts(None, 'one', 'two', []),
            'one-two')

        self.assertEquals(
            routing.name_from_canonical_parts('pre', 'one', 'two', []),
            'pre-one-two')

        self.assertEquals(
            routing.name_from_canonical_parts(None, 'one', 'two', ['x', 'y']),
            'one-two')

        self.assertEquals(
            routing.name_from_canonical_parts('pre', 'one', 'two', ['x', 'y']),
            'pre-one-two')
コード例 #3
0
ファイル: test_routing.py プロジェクト: Tapsa/Ferris
    def testNameFromParts(self):

        self.assertEquals(
            routing.name_from_canonical_parts(None, 'one', 'two', []),
            'one-two'
        )

        self.assertEquals(
            routing.name_from_canonical_parts('pre', 'one', 'two', []),
            'pre-one-two'
        )

        self.assertEquals(
            routing.name_from_canonical_parts(None, 'one', 'two', ['x', 'y']),
            'one-two'
        )

        self.assertEquals(
            routing.name_from_canonical_parts('pre', 'one', 'two', ['x', 'y']),
            'pre-one-two'
        )
コード例 #4
0
ファイル: uri.py プロジェクト: russomi/russomi-ferris-blog
    def get_route_name(self,
        prefix=route_sentinel, controller=route_sentinel, action=route_sentinel):
        """
        Function used to build the route name for a given prefix, controller, and
        action. For example, build_action_route('admin','pages','view', id=2)
        will give you "admin:pages:view". Set prefix to False to exclude the
        current prefix from the route name.
        """
        prefix = prefix if prefix != route_sentinel else self.route.prefix
        controller = controller if controller != route_sentinel else self.route.controller
        action = action if action != route_sentinel else self.route.action

        return routing.name_from_canonical_parts(prefix, controller, action)
コード例 #5
0
ファイル: uri.py プロジェクト: jeury301/njit-advising-system
    def get_route_name(self,
                       prefix=route_sentinel,
                       controller=route_sentinel,
                       action=route_sentinel):
        """
        Function used to build the route name for a given prefix, controller, and
        action. For example, build_action_route('admin','pages','view', id=2)
        will give you "admin:pages:view". Set prefix to False to exclude the
        current prefix from the route name.
        """
        prefix = prefix if prefix != route_sentinel else self.route.prefix
        controller = controller if controller != route_sentinel else self.route.controller
        action = action if action != route_sentinel else self.route.action

        return routing.name_from_canonical_parts(prefix, controller, action)
コード例 #6
0
ファイル: uri.py プロジェクト: cedrickddl/ferris-framework
    def get_route_name(self,
        prefix=route_sentinel, handler=route_sentinel, action=route_sentinel):
        """
        Function used to build the route name for a given prefix, handler, and
        action. For example, build_action_route('admin','pages','view', id=2)
        will give you "admin-pages-view". Set prefix to False to exclude the
        current prefix from the route name.
        """
        prefix = prefix if prefix != route_sentinel else self.prefix
        handler = handler if handler != route_sentinel else self.name
        action = action if action != route_sentinel else self.action

        if self.prefix:
            action = action.replace(self.prefix + '_', '')

        return routing.name_from_canonical_parts(prefix, handler, action)
コード例 #7
0
ファイル: uri.py プロジェクト: fredyang/ferris-framework
    def get_route_name(self,
                       prefix=route_sentinel,
                       handler=route_sentinel,
                       action=route_sentinel):
        """
        Function used to build the route name for a given prefix, handler, and
        action. For example, build_action_route('admin','pages','view', id=2)
        will give you "admin-pages-view". Set prefix to False to exclude the
        current prefix from the route name.
        """
        prefix = prefix if prefix != route_sentinel else self.prefix
        handler = handler if handler != route_sentinel else self.name
        action = action if action != route_sentinel else self.action

        if self.prefix:
            action = action.replace(self.prefix + '_', '')

        return routing.name_from_canonical_parts(prefix, handler, action)