diff options
| author | Tim Graham <timograham@gmail.com> | 2019-01-11 15:28:22 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-11 15:28:22 -0500 |
| commit | 8f4eee177785cba27d6181840206ff2f164f2960 (patch) | |
| tree | 72a5627fc929badb80be81b4addfaa23fad4927f /django/conf/__init__.py | |
| parent | 76d31be2d04dd6e6bcb5cb39a29ea9ed3938d0f9 (diff) | |
Moved django.db.migrations.writer.SettingsReference to django.conf.
Reduces the possibility of circular imports.
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. |
