agateblue / agateblue/django-dynamic-preferences
The documentation regarding the use of global_preferences_registry.manager() is not clear
未關閉
- 主要語言
- Python
- 星號
- 359
- 分支
- 86
- PR 合併指標
- 30 天內沒有已合併 PR
描述
the documentation suggests that a pattern as below works
```python
prefs = global_preferences_registry.manager()
my_preference = prefs.get('my_section__my_ name')
```
it does but **it will not pick the current value of the preference**. one needs to use something along the lines of
```python
def get_preference(key=None):
"""
get the preference
"""
preferences = global_preferences_registry.manager().load_from_db()
try:
return preferences.get(key)
except Exception as error:
raise error
```
I suggest that the documentation is updated to reflect this
貢獻指南
評估
這個 Issue 還沒有評估資料。