Rename signal to config_updated

This commit is contained in:
Camilo Nova 2016-09-14 14:53:52 -05:00
parent 395efc992f
commit 1d746c080f
4 changed files with 6 additions and 6 deletions

View file

@ -86,7 +86,7 @@ class DatabaseBackend(Backend):
if self._cache:
self._cache.set(key, value)
signals.updated_signal.send(sender='constance', key=key, value=value)
signals.config_updated.send(sender='constance', key=key, value=value)
def clear(self, sender, instance, created, **kwargs):
if self._cache and not created:

View file

@ -49,4 +49,4 @@ class RedisBackend(Backend):
def set(self, key, value):
self._rd.set(self.add_prefix(key), dumps(value))
signals.updated_signal.send(sender='constance', key=key, value=value)
signals.config_updated.send(sender='constance', key=key, value=value)

View file

@ -1,3 +1,3 @@
import django.dispatch
updated_signal = django.dispatch.Signal(providing_args=['key', 'value'])
config_updated = django.dispatch.Signal(providing_args=['key', 'value'])

View file

@ -72,15 +72,15 @@ Use this option in order to skip hash verification.
Signals
-------
Each time a value is changed it will trigger a `updated_signal` signal.
Each time a value is changed it will trigger a `config_updated` signal.
You can use it as:
.. code-block:: python
from constance.signals import updated_signal
from constance.signals import config_updated
@receiver(updated_signal)
@receiver(config_updated)
def constance_updated(sender, key, value, **kwargs):
print(sender, key, value)