Simple app to add configuration options to a Django project.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'master' into develop

+17 -4
+6 -1
HISTORY.rst
··· 3 3 History 4 4 ------- 5 5 6 + 2.0.1 (2019-08-27) 7 + ++++++++++++++++++ 8 + 9 + * Fixed bug with import settings. 10 + 6 11 2.0 (2019-08-27) 7 - +++++++++++++++++ 12 + ++++++++++++++++ 8 13 9 14 * Drop support for Python 2. 10 15 * ``Option`` model and ``UserOption`` model are now swappable.
+1 -1
options/__init__.py
··· 14 14 "TYPE_CHOICES", 15 15 "CONVERTER", 16 16 ] 17 - __version__ = "2.0.0" 17 + __version__ = "2.0.1"
+4 -1
options/helpers.py
··· 9 9 from django.utils.text import slugify 10 10 11 11 from options.constants import INT, FLOAT, STRING, CONVERTER 12 - from options.settings import DEFAULT_OPTION_MODEL, DEFAULT_USER_OPTION_MODEL 13 12 14 13 15 14 def get_option_model(): 16 15 """Return the Notification model that is active in this project.""" 16 + from options.settings import DEFAULT_OPTION_MODEL 17 + 17 18 try: 18 19 return django_apps.get_model(DEFAULT_OPTION_MODEL, require_ready=False) 19 20 except ValueError: ··· 29 30 30 31 def get_user_option_model(): 31 32 """Return the Notification model that is active in this project.""" 33 + from options.settings import DEFAULT_USER_OPTION_MODEL 34 + 32 35 try: 33 36 return django_apps.get_model(DEFAULT_USER_OPTION_MODEL, require_ready=False) 34 37 except ValueError:
+6 -1
tests/settings.py
··· 30 30 "rest_framework.authentication.SessionAuthentication", 31 31 ) 32 32 } 33 + from options.constants import STRING 33 34 34 35 SIMPLE_OPTIONS_CONFIGURATION = { 35 - "default_option": {"public_name": "Default Option", "type": 2, "value": "default"} 36 + "default_option": { 37 + "public_name": "Default Option", 38 + "type": STRING, 39 + "value": "default", 40 + } 36 41 } 37 42 SIMPLE_OPTIONS_EXCLUDE_USER = ["secret_option"]