django-dynamic-preferences
django-dynamic-preferences copied to clipboard
Support other cache than 'default'
There is no way of configuring which cache should be used when caching preferences. The 'default' cache is always used. It would be nice if it were possible to configure this. Currently we have to monkey-patch the PreferencesManager
to achieve this.
Indeed, I can see how it could be an issue. I'd gladly review and merge a PR for this. If anyone wants to give it a try, you can:
- Add a new
CACHE_NAME
setting at https://github.com/agateblue/django-dynamic-preferences/blob/097c7766c2b895cd805c919ce6ac4a8a8dccc885/dynamic_preferences/settings.py (with a default todefault
for backward compatibility - Update https://github.com/agateblue/django-dynamic-preferences/blob/07362d97a24c26158b13a58a344feaa7193846aa/dynamic_preferences/managers.py#L28 to use the
CACHE_NAME
setting defined in 1. - A couple of lines in https://github.com/agateblue/django-dynamic-preferences/blob/develop/docs/installation.rst#settings to document this new setting