Hello, is Routes currently working with TG2 (1.9.7a4)?
I'm currently using Routes in my TG1 app and wanted to look and check how much work it will be if I wanted to port it TG2. So I installed a TG2 environment (like described on the wiki) and create an application (with quickstart) for testing. I tried then following http://www.turbogears.org/2.0/docs/main/RoutesIntegration.html. The first problem was to get my own setup_routes() method called. I tried to add a my_setup_routes() method (based on the default setup_routes() method to config/app_cfg.py and setting at the end of the file "base_config.setup_routes = my_setup_routes". Perhaps I misunderstood the wiki page because this didn't work (I added a small print statement to check if my method gets called at all). My current attempt is (which seems to work): create a MyAppConfig class based on the default AppConfig, override setup_routes() method and instantiate base_config from MyAppConfig. At least this way my own setup_routes get called. The next step was to add a line map.connect('index2', controller='root', action='index') before the default route. But when I try to access "index2" I get a 404. I'm doing something wrong or is Routes support in TG2 currently broken? I tried to figure out why it didn't work and it looks to me like it gets correctly resolved to the "index" method of the "root" controller (passed as func to _perform_call) but _perform_call from TGController tries again from the start to find the controller and uses the url for it (here "index2") and doesn't find a "index2" method. (I'm not familiar with the TG2 code so my analysis might be wrong). BTW: There is a bug in tg/wsgiapp.py: "sys" gets imported twice and there is no definition for log. It looks like it's missing import logging log = logging.getLogger(__name__) Michael --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

