preferences.py 313 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
from django.conf import settings
from dynamic_preferences.registries import global_preferences_registry


class DefaultFromSettingMixin(object):
    def get_default(self):
        return getattr(settings, self.setting)


def get(pref):
    manager = global_preferences_registry.manager()
    return manager[pref]