Part of lp.app.browser.launchpad View In Hierarchy
Keeps templates that are registered as pages from being URL accessable.
The standard pattern in LP is to register templates that contain macros as views on all objects:
Without this class, that pattern would make the template URL traversable from any object. Therefore requests like these would all "work":
http://launchpad.net/+main-template-macros http://launchpad.net/ubuntu/+main-template-macros http://launchpad.net/ubuntu/+main-template-macros https://blueprints.launchpad.test/ubuntu/hoary/+main-template-macros
Obviously, those requests wouldn't do anything useful and would instead generate an OOPS.
It would be nice to use a different pattern for macros instead, but we've grown dependent on some of the peculiatrities of registering macro templates in this way.
This class was created in order to prevent macro templates from being accessable via URL without having to make nontrivial changes to the many, many templates that use macros. To use the class add a "class" parameter to macro template registrations:
Method | __init__ | Undocumented |
Method | traverse | Undocumented |
Method | browserDefault | Undocumented |
Method | publishTraverse | Undocumented |
Method | __call__ | Undocumented |