コード例 #1
0
ファイル: urls.py プロジェクト: jmoliveira/supercraques
# coding: utf-8
#!/usr/bin/env python

from torneira.core.dispatcher import url
from supercraques.controller.banca import BancaController
from supercraques.controller.home import HomeController
from supercraques.controller.facebook import FacebookController
from supercraques.controller.desafio import DesafioController

urls = (
    url("/", HomeController, action="login", name="login"),
    url("/login", HomeController, action="login", name="login"),
    url("/auth/login", HomeController, action="auth_login", name="auth_login"),
    url("/home", HomeController, action="home", name="home"),
    url("/equipes.{extension}", BancaController, action="busca_equipes", name="busca_equipes"),
    url(
        "/equipe/{equipe_id}/atletas.{extension}",
        BancaController,
        action="busca_atletas_por_equipe",
        name="busca_atletas_por_equipe",
    ),
    url(
        "/equipe/{equipe_id}/posicao/{posicao}/atletas.{extension}",
        BancaController,
        action="busca_atletas_por_equipe_e_posicao",
        name="busca_atletas_por_equipe_e_posicao",
    ),
    url(
        "/posicao/{posicao}/atletas.{extension}",
        BancaController,
        action="busca_atletas_por_posicao",
コード例 #2
0
ファイル: test_dispatcher.py プロジェクト: strogo/torneira
 def test_can_be_create_url(self):
     
     url = dispatcher.url(route="shouldBeRoute", controller="shouldBeController", action="shouldBeAction", name="shouldBeName")
     self.assertEqual(url, ['shouldBeName', 'shouldBeRoute', 'shouldBeController', 'shouldBeAction'])
     
# coding: utf-8
#!/usr/bin/env python

from torneira.core.dispatcher import url
from supercraques.controller.banca import BancaController
from supercraques.controller.home import HomeController
from supercraques.controller.facebook import FacebookController
from supercraques.controller.desafio import DesafioController

urls = (
    url("/", HomeController, action="login", name="login"),
    url("/login", HomeController, action="login", name="login"),
    url("/auth/login", HomeController, action="auth_login", name="auth_login"),
    url("/home", HomeController, action="home", name="home"),
    url("/equipes.{extension}",
        BancaController,
        action="busca_equipes",
        name="busca_equipes"),
    url("/equipe/{equipe_id}/atletas.{extension}",
        BancaController,
        action="busca_atletas_por_equipe",
        name="busca_atletas_por_equipe"),
    url("/equipe/{equipe_id}/posicao/{posicao}/atletas.{extension}",
        BancaController,
        action="busca_atletas_por_equipe_e_posicao",
        name="busca_atletas_por_equipe_e_posicao"),
    url("/posicao/{posicao}/atletas.{extension}",
        BancaController,
        action="busca_atletas_por_posicao",
        name="busca_atletas_por_posicao"),
    url("/banca", BancaController, action="banca", name="banca"),
from torneira.core.dispatcher import url
from twittface.controller.home import HomeController
from twittface.controller.voto import VotoController
from twittface.controller.login import LoginController
from twittface.controller.search import SearchController
from twittface.controller.campanha import CampanhaController

urls = (
    url("/", HomeController, action="", name="home"),
    url("/voto", VotoController, action="", name=""),
    url("/random_target",
        VotoController,
        action="random_target",
        name="random_target"),
    url("/login", LoginController, action="index", name="login_index"),
    url("/logout", LoginController, action="logout", name="login_logout"),
    url("/login/oauth", LoginController, action="oauth", name="login_oauth"),
    url("/login/oauth_callback",
        LoginController,
        action="oauth_callback",
        name="login_oauth_callback"),
    url("/campanha/lista",
        CampanhaController,
        action="lista",
        name="campanha_lista"),
    url("/campanha/voto",
        CampanhaController,
        action="voto",
        name="campanha_voto"),
    url("/search/result.json", SearchController, action="result", name=""),
)
コード例 #5
0
from torneira.core.dispatcher import url
from controller.home import HomeController
from controller.site import SiteController
from controller.server import ServerController

urls = (
    url("/", HomeController, action="", name="home"),
    url("/login", HomeController, action="login", name="login"),
    url("/site", SiteController, action="", name="new_site"),
    url("/site/{site_id}/edit", SiteController, action="", name="update_site"),
    url("/site/{site_id}",
        SiteController,
        action="view_site",
        name="view_site"),
    url("/server", ServerController, action="", name="new_server"),
    url("/server/{server_id}/edit",
        ServerController,
        action="",
        name="update_server"),
)
コード例 #6
0
from torneira.core.dispatcher import url


class SimpleController(BaseController):
    def index(self, *args, **kwargs):
        return 'index ok'

    def with_parameter(self, param, request_handler):
        return "action_with_parameter " + param

    def preserve_url_name(self, request_handler):
        return request_handler.reverse_url('name-of-url')


urls = (
    url('/controller/simple/', SimpleController, action='index', name='index'),
    url('/controller/parameter/{param}', SimpleController, action='with_parameter', name='with_parameter'),
    url('/controller/preserve-name/', SimpleController, action='preserve_url_name', name='name-of-url'),
)
app = Application(urls, cookie_secret='secret')


class DispatcherTestCase(AsyncHTTPTestCase):
    def get_app(self):
        return app

    def test_use_routes_for_map_a_simple_url(self):
        response = self.fetch('/controller/simple/')
        self.assertEqual(response.code, 200)
        self.assertEqual(response.body, 'index ok')
コード例 #7
0
ファイル: urls.py プロジェクト: AmineAbidi1/nginx-monitor
from torneira.core.dispatcher import url
from controller.home import HomeController
from controller.site import SiteController
from controller.server import ServerController

urls = (
    url("/", HomeController, action="", name="home"),    

    url("/login", HomeController, action="login", name="login"),
    
    url("/site", SiteController, action="", name="new_site"),    
    url("/site/{site_id}/edit", SiteController, action="", name="update_site"),    
    url("/site/{site_id}", SiteController, action="view_site", name="view_site"),

    url("/server", ServerController, action="", name="new_server"),    
    url("/server/{server_id}/edit", ServerController, action="", name="update_server"),    

)
コード例 #8
0
ファイル: urls.py プロジェクト: strogo/torneira
from torneira.core.dispatcher import url
from controller.home import HomeController

urls = (
    url(r"/", HomeController, name="home-index"),
)
コード例 #9
0
ファイル: urls.py プロジェクト: marcelnicolay/videoadx-simple
from torneira.core.dispatcher import url
from controller import VideologController

urls = (
	url(r"/player/{user_id}/{source_id}/config.xml", VideologController, action='config', name="videolog-config"),
)
コード例 #10
0
from torneira.core.dispatcher import url
from twittface.controller.home import HomeController
from twittface.controller.voto import VotoController
from twittface.controller.login import LoginController
from twittface.controller.search import SearchController
from twittface.controller.campanha import CampanhaController

urls = (
    url("/", HomeController, action="", name="home"),    
    url("/voto", VotoController, action="", name=""),
    url("/random_target", VotoController, action="random_target", name="random_target"),
    url("/login", LoginController, action="index", name="login_index"),    
    url("/logout", LoginController, action="logout", name="login_logout"),    
    url("/login/oauth", LoginController, action="oauth", name="login_oauth"),    
    url("/login/oauth_callback", LoginController, action="oauth_callback", name="login_oauth_callback"),    

    url("/campanha/lista", CampanhaController, action="lista", name="campanha_lista"),    
    url("/campanha/voto", CampanhaController, action="voto", name="campanha_voto"),    

    url("/search/result.json", SearchController, action="result", name=""),
)