|
@@ -9,6 +9,8 @@ from django.db.models.signals import post_save
|
|
|
from django.dispatch import receiver
|
|
from django.dispatch import receiver
|
|
|
from django.utils import timezone
|
|
from django.utils import timezone
|
|
|
|
|
|
|
|
|
|
+from utilities.utils import flatten_dict
|
|
|
|
|
+
|
|
|
|
|
|
|
|
__all__ = (
|
|
__all__ = (
|
|
|
'Token',
|
|
'Token',
|
|
@@ -54,6 +56,12 @@ class UserConfig(models.Model):
|
|
|
|
|
|
|
|
return d
|
|
return d
|
|
|
|
|
|
|
|
|
|
+ def all(self):
|
|
|
|
|
+ """
|
|
|
|
|
+ Return a dictionary of all defined keys and their values.
|
|
|
|
|
+ """
|
|
|
|
|
+ return flatten_dict(self.data)
|
|
|
|
|
+
|
|
|
def set(self, path, value, commit=False):
|
|
def set(self, path, value, commit=False):
|
|
|
"""
|
|
"""
|
|
|
Define or overwrite a configuration parameter. Example:
|
|
Define or overwrite a configuration parameter. Example:
|