| Total Complexity | 3 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| 1 | from django.conf import settings |
||
| 4 | class Settings(object): |
||
| 5 | CACHALOT_ENABLED = True |
||
| 6 | CACHALOT_CACHE = 'default' |
||
| 7 | CACHALOT_CACHE_RANDOM = False |
||
| 8 | CACHALOT_INVALIDATE_RAW = True |
||
| 9 | CACHALOT_ONLY_CACHABLE_TABLES = frozenset() |
||
| 10 | CACHALOT_UNCACHABLE_TABLES = frozenset(('django_migrations',)) |
||
| 11 | CACHALOT_QUERY_KEYGEN = 'cachalot.utils.get_query_cache_key' |
||
| 12 | CACHALOT_TABLE_KEYGEN = 'cachalot.utils.get_table_cache_key' |
||
| 13 | |||
| 14 | def __getattribute__(self, item): |
||
| 15 | if hasattr(settings, item): |
||
| 16 | return getattr(settings, item) |
||
| 17 | return super(Settings, self).__getattribute__(item) |
||
| 18 | |||
| 19 | def __setattr__(self, key, value): |
||
| 20 | raise AttributeError( |
||
| 21 | "Don't modify `cachalot_settings`, use " |
||
| 22 | "`django.test.utils.override_settings` or " |
||
| 27 |