diff options
Diffstat (limited to 'django/conf/__init__.py')
| -rw-r--r-- | django/conf/__init__.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py index 73d943d26e..cf91ce83d4 100644 --- a/django/conf/__init__.py +++ b/django/conf/__init__.py @@ -30,6 +30,18 @@ FILE_CHARSET_DEPRECATED_MSG = ( ) +class SettingsReference(str): + """ + String subclass which references a current settings value. It's treated as + the value in memory but serializes to a settings.NAME attribute reference. + """ + def __new__(self, value, setting_name): + return str.__new__(self, value) + + def __init__(self, value, setting_name): + self.setting_name = setting_name + + class LazySettings(LazyObject): """ A lazy proxy for either global Django settings or a custom settings object. |
