agateblue / agateblue/django-dynamic-preferences
The documentation regarding the use of global_preferences_registry.manager() is not clear
Abierto
- Lenguaje dominante
- Python
- Estrellas
- 359
- Forks
- 86
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.