Allow TemplateHook to be selective based on URL name
Review Request #1629 — Created May 31, 2010 and submitted — Latest diff uploaded
TemplateHook currently allows extensions to insert templates into our Django app. So, for example, we have a hook called "base-scripts-post" which inserts templates on the base template. Now, while creating a TemplateHook, we can supply an optional apply_to list parameter which allows us to specify which view functions should really render the hook. For example: TemplateHook(self, "base-scripts-post", "rbstats/rbstats_dlgs.html", ["dashboard"]) Now rbstats_dlgs.html will only be rendered on the dashboard view function. I'm not entirely sure if my way of finding "func_name" is the way to go. Open to suggestions.
Manual.