# Path: hedwig/core/settings.py
# class Settings(object):
#     """
#     A settings object, that allows HEDWIG settings to be accessed as properties.
#     """
# 
#     def __init__(self, user_settings=None, defaults=None):
#         self.user_settings = user_settings or {}
#         self.defaults = defaults or DEFAULTS
#         if isinstance(self.user_settings, dict):
#             self.user_settings = dict_merge(self.defaults, self.user_settings)
#         else:
#             raise TypeError("Expected settings to be a dict")
# 
#     def __getattr__(self, attr):
#         if attr not in self.defaults.keys():
#             raise AttributeError("Invalid HEDWIG setting: '%s'" % attr)
# 
#         try:
#             # Check if present in user settings
#             val = self.user_settings[attr]
#         except KeyError:
#             # Fall back to defaults
#             val = self.defaults[attr]
# 
#         # Cache the result
#         setattr(self, attr, val)
#         return val
# 
#     def __getitem__(self, item):
#         return getattr(self, item)
# 
# DEFAULTS = {
#     'EXCHANGE': 'hedwig',
#     'EXCHANGE_TYPE': 'topic',
#     'HEARTBEAT_INTERVAL': 5,
#     'SOCKET_TIMEOUT': 1,
#     'HOST': 'localhost',
#     'PORT': 5672,
#     'VHOST': '',
#     'USERNAME': '',
#     'PASSWORD': '',
#     'EMITTER': {
#         'RAISE_EXCEPTION': False,
#     },
#     'CONSUMER': {
#         'RAISE_EXCEPTION': False,
#         'QUEUES': {}
#     }
# }


import os
from django.conf import settings
from hedwig.core.settings import Settings, DEFAULTS


HEDWIG_USER_SETTINGS = getattr(settings, 'HEDWIG', None)
HEDWIG_DJANGO_USER_SETTINGS = getattr(settings, 'HEDWIG_DJANGO', None)


DJANGO_DEFAULTS = {
    'MODEL_SIGNALS': False,
    'HIDE_FIELDS': False,
    'NATURAL_PRIMARY_KEYS': True,
    'NATURAL_FOREIGN_KEYS': True
}

hedwig_settings = Settings(HEDWIG_USER_SETTINGS, DEFAULTS)

# Path: hedwig/core/settings.py
# class Settings(object):
#     """
#     A settings object, that allows HEDWIG settings to be accessed as properties.
#     """
# 
#     def __init__(self, user_settings=None, defaults=None):
#         self.user_settings = user_settings or {}
#         self.defaults = defaults or DEFAULTS
#         if isinstance(self.user_settings, dict):
#             self.user_settings = dict_merge(self.defaults, self.user_settings)
#         else:
#             raise TypeError("Expected settings to be a dict")
# 
#     def __getattr__(self, attr):
#         if attr not in self.defaults.keys():
#             raise AttributeError("Invalid HEDWIG setting: '%s'" % attr)
# 
#         try:
#             # Check if present in user settings
#             val = self.user_settings[attr]
#         except KeyError:
#             # Fall back to defaults
#             val = self.defaults[attr]
# 
#         # Cache the result
#         setattr(self, attr, val)
#         return val
# 
#     def __getitem__(self, item):
#         return getattr(self, item)
# 
# DEFAULTS = {
#     'EXCHANGE': 'hedwig',
#     'EXCHANGE_TYPE': 'topic',
#     'HEARTBEAT_INTERVAL': 5,
#     'SOCKET_TIMEOUT': 1,
#     'HOST': 'localhost',
#     'PORT': 5672,
#     'VHOST': '',
#     'USERNAME': '',
#     'PASSWORD': '',
#     'EMITTER': {
#         'RAISE_EXCEPTION': False,
#     },
#     'CONSUMER': {
#         'RAISE_EXCEPTION': False,
#         'QUEUES': {}
#     }
# }


# Path: hedwig/django/settings.py
import os
from django.conf import settings
from hedwig.core.settings import Settings, DEFAULTS



HEDWIG_USER_SETTINGS = getattr(settings, 'HEDWIG', None)
HEDWIG_DJANGO_USER_SETTINGS = getattr(settings, 'HEDWIG_DJANGO', None)


DJANGO_DEFAULTS = {
    'MODEL_SIGNALS': False,
    'HIDE_FIELDS': False,
    'NATURAL_PRIMARY_KEYS': True,
    'NATURAL_FOREIGN_KEYS': True
}

hedwig_settings = Settings(HEDWIG_USER_SETTINGS, DEFAULTS)

hedwig_django_settings = Settings(HEDWIG_DJANGO_USER_SETTINGS, DJANGO_DEFAULTS)