I have refactored the dispatch system to be more flexible and support new ways to do dispatch. ObjectDispatch and RestDispatch are implemented. All of the unit tests pass and a bunch of new ones have been added. I removed a couple of tests which were class decorator- specific because I don't feel we are ready to support this yet. I would be happy to work with Gustavo to make this work, as long as it is not complicated and does not affect the speed of the dispatch. Much of the original allow_only code has been bypassed in this branch. I think there is a clear difference between TG controllers and Pylons controllers, and we need to maintain that distinction. For instance, I don't believe that we should override or extend __before__ to execute security functionality.
Some notes on the change: __before__ and __after__ are deprecated in favor of _before and _after (this change is coming to pylons as well) _dispatch is a new controller method which allows the developer to override the way the URL is consumed. (You my now add your own XML RPC dispatcher for instance) RestController now supports variable arguments when it introspects the controller methods in it's dispatch. The controllers.py module has been split into a few separate files: util.py contains helper functions like url and redirect. dispatch.py: Defines the basic dispatch mechanism for the system, and includes ObjectDispatch decoratedcontroller.py: This functionality has been separated out into it's own class. (dispatch is now separate functionality from decoration) For instance, TGController is made up of ObjectDispatch and DecoratedController tgcontroller.py: Combines ObjectDispatch and DecoratedController restcontroller.py: RESTful dispatch and Controller. wsgiappcontroller.py:obvious (all api imports still work) Here is the branch. I encourage one of our committers to merge it in with the new tip. http://bitbucket.org/percious/tg-21/ cheers. -chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
