On Jan 8, 2007, at 2:11 PM, [EMAIL PROTECTED] wrote:


Hi all,

Anyone know if it's possible to create irregular controller names in
Turbogears.  Or aliases.

I'm basically wanting to emulate a legacy interface with my app, which
means that I need to support a URL of the form
http://mysite.com/opt_out.php?email=address&pass=secret

Can I do this somehow?

You can define a "default" method in your Root controller. Something like:


class Root(RootController):
        class default(self, *args, **kw):
                args = list(args)
                try:
                        atom = args.pop(0)
                except KeyError:
                        raise cherrypy.NotFound
                if atom == "opt_out.php":
                        return self.aliased_method(*args, **kw)
                raise cherrypy.NotFound

HTH,
Alberto

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to