From eaeb4475a21c57a7ac4cfd76c94ad24c3e229603 Mon Sep 17 00:00:00 2001 From: Camilo Nova Date: Wed, 14 Sep 2016 12:37:19 -0500 Subject: [PATCH] Added documentation on signals --- docs/index.rst | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 9ded059..1e99cb6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -68,6 +68,25 @@ Use this option in order to skip hash verification. CONSTANCE_IGNORE_ADMIN_VERSION_CHECK = True + +Signals +------- + +Each time a value is changed it will trigger a `updated_signal` signal. + +You can use it as: + +.. code-block:: python + from constance import updated_signal + + @receiver(updated_signal) + def constance_updated(sender, key, value, **kwargs): + print(sender, key, value) + +In case you need it the sender is `constance`, and the key and value are +the ones just changed. + + Custom fields ------------- @@ -132,7 +151,7 @@ In order to Order the fields , you can use OrderedDict collection. Here is an ex ('SITE_DESCRIPTION', ('', 'Website description')), ('THEME', ('light-blue', 'Website theme')), ] - + Fieldsets ---------