mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Rename signal to config_updated
This commit is contained in:
parent
395efc992f
commit
1d746c080f
4 changed files with 6 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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'])
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue