On Apr 2, 2006, at 12:43 PM, Kendall Clark wrote:
In the case of restrict, it would throw a 404. If you wanted instead of restricting, to have something else happen, you'd use dispatch_on decorator. Your example would come out: map.connect("instances", "kb/instances", controller="kb", action="") class KbController(BaseController): [EMAIL PROTECTED](POST='make_instance') def instances(self): # Handles the get def make_instance(self): # Handles the post So Routes continues to handle just the URL recognition, and you alter action dispatching using the decorator. Personally, just looking at it... I like it. It has the explictness of action mapping you like, and it doesn't require me to be flipping to routing.py to see where things are going, since the decorator makes it very clear what will change the action dispatch.
So overall with this approach, we're only one away from what I think would be your ideal situation. That is, you're still stuck with a "default" action regardless of HTTP verb. Or does this cover your situation in a satisfactory manner? Cheers, Ben --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss -~----------~----~----~----~------~----~------~--~--- |
- Re: routes request Ben Bangert
- Re: routes request Kendall Clark
- Re: routes request Ben Bangert
- Re: routes request Kendall Clark
- Re: routes request Ben Bangert
- Re: routes request Jos Yule
- Re: routes request Kendall Clark
- Re: routes request Ben Bangert
- Re: routes request [EMAIL PROTECTED]
- Re: routes request [EMAIL PROTECTED]
- Re: routes request Ben Bangert
- Re: routes request iGL
- Re: routes request Neil
