Merge branch 'release/0.9.2'
[philo.git] / philo / signals.py
1 from django.dispatch import Signal
2
3
4 #: Sent whenever an Entity subclass has been "prepared" -- that is, after the processing necessary to make :mod:`.AttributeProxyField`\ s work has been completed. This will fire after :obj:`django.db.models.signals.class_prepared`.
5 #:
6 #: Arguments that are sent with this signal:
7 #: 
8 #: ``sender``
9 #:      The model class.
10 entity_class_prepared = Signal(providing_args=['class'])
11
12 #: Sent when a :class:`~philo.models.nodes.View` instance is about to render. This allows you, for example, to modify the ``extra_context`` dictionary used in rendering.
13 #:
14 #: Arguments that are sent with this signal:
15 #:
16 #: ``sender``
17 #:      The :class:`~philo.models.nodes.View` instance
18 #:
19 #: ``request``
20 #:      The :class:`HttpRequest` instance which the :class:`~philo.models.nodes.View` is rendering in response to.
21 #:
22 #: ``extra_context``
23 #:      A dictionary which will be passed into :meth:`~philo.models.nodes.View.actually_render_to_response`.
24 view_about_to_render = Signal(providing_args=['request', 'extra_context'])
25
26 #: Sent when a view instance has finished rendering.
27 #:
28 #: Arguments that are sent with this signal:
29 #:
30 #: ``sender``
31 #:      The :class:`~philo.models.nodes.View` instance
32 #:
33 #: ``response``
34 #:      The :class:`HttpResponse` instance which :class:`~philo.models.nodes.View` view has rendered to.
35 view_finished_rendering = Signal(providing_args=['response'])
36
37 #: Sent when a :class:`~philo.models.pages.Page` instance is about to render as a string. If the :class:`~philo.models.pages.Page` is rendering as a response, this signal is sent after :obj:`view_about_to_render` and serves a similar function. However, there are situations where a :class:`~philo.models.pages.Page` may be rendered as a string without being rendered as a response afterwards.
38 #:
39 #: Arguments that are sent with this signal:
40 #:
41 #: ``sender``
42 #:      The :class:`~philo.models.pages.Page` instance
43 #:
44 #: ``request``
45 #:      The :class:`HttpRequest` instance which the :class:`~philo.models.pages.Page` is rendering in response to (if any).
46 #:
47 #: ``extra_context``
48 #:      A dictionary which will be passed into the :class:`Template` context.
49 page_about_to_render_to_string = Signal(providing_args=['request', 'extra_context'])
50
51 #: Sent when a :class:`~philo.models.pages.Page` instance has just finished rendering as a string. If the :class:`~philo.models.pages.Page` is rendering as a response, this signal is sent before :obj:`view_finished_rendering` and serves a similar function. However, there are situations where a :class:`~philo.models.pages.Page` may be rendered as a string without being rendered as a response afterwards.
52 #:
53 #: Arguments that are sent with this signal:
54 #:
55 #: ``sender``
56 #:      The :class:`~philo.models.pages.Page` instance
57 #:
58 #: ``string``
59 #:      The string which the :class:`~philo.models.pages.Page` has rendered to.
60 page_finished_rendering_to_string = Signal(providing_args=['string'])