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.
Diff Revision 2
This is not the most recent revision of the diff. The latest diff is revision 5. See what's changed.
orig
1
2
3
4
5
djblets/extensions/base.py |
---|
djblets/extensions/hooks.py |
---|
djblets/extensions/middleware.py |
---|
djblets/extensions/templatetags/djblets_extensions.py |
---|