X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/82e22de23b182353e35aa4e2fde0c08f4df5653f..4124d776c70ea5a7cf8bd08223f61bc1c73af348:/signals.py?ds=sidebyside diff --git a/signals.py b/signals.py index e76f319..37ea3b1 100644 --- a/signals.py +++ b/signals.py @@ -1,3 +1,15 @@ from django.dispatch import Signal -entity_class_prepared = Signal(providing_args=['class']) \ No newline at end of file + +entity_class_prepared = Signal(providing_args=['class']) +view_about_to_render = Signal(providing_args=['node', 'request', 'path', 'subpath', 'extra_context']) +view_finished_rendering = Signal(providing_args=['response']) +page_about_to_render_to_string = Signal(providing_args=['node', 'request', 'path', 'subpath', 'extra_context']) +page_finished_rendering_to_string = Signal(providing_args=['string']) + + +def replace_sender_response(sender, response): + """Helper function to swap in a new response.""" + def render_to_response(self, *args, **kwargs): + return response + sender.actually_render_to_response = render_to_response \ No newline at end of file