django-notifications/notifications/settings.py

21 lines
403 B
Python
Raw Normal View History

2018-05-31 03:05:08 +00:00
''' Django notifications settings file '''
2018-05-30 05:18:33 +00:00
# -*- coding: utf-8 -*-
from django.conf import settings
2018-05-31 03:05:08 +00:00
2018-05-30 05:18:33 +00:00
CONFIG_DEFAULTS = {
'PAGINATE_BY': 20,
2018-05-31 02:03:57 +00:00
'USE_JSONFIELD': False,
'SOFT_DELETE': False,
'NUM_TO_FETCH': 10,
2018-05-30 05:18:33 +00:00
}
2018-05-31 03:05:08 +00:00
2018-05-30 05:18:33 +00:00
def get_config():
2018-05-31 03:05:08 +00:00
user_config = getattr(settings, 'DJANGO_NOTIFICATIONS_CONFIG', {})
2018-05-30 05:18:33 +00:00
2018-05-31 03:05:08 +00:00
config = CONFIG_DEFAULTS.copy()
config.update(user_config)
2018-05-30 05:18:33 +00:00
2018-05-31 03:05:08 +00:00
return config