Pylons/pyramid_handlers — pull request #3 by jvanasco (2012-01-20 19:03:16+00:00)
Title: added support for a default_action to config.add_handler

I added support for a "default_action" kwarg to add_handlers

This allows the following two config lines to be collapsed into one:

was:
config.add_handler("test", "/test/", "app.handlers.test:Test", action="index")
config.add_handler("test", "/test/{action}", "app.handlers.test:Test")

now:
config.add_handler("test", "/test/{action}", "app.handlers.test:Test", default_action="index")

it does this by implicitly creating another route named "test-default_action" , removing the ":action" args from the pattern, and subbing in "default_action" for "action"

I wasn't sure how the inheritance worked, so I used "add_handler(self" instead of "self.add_handler(".