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 'develop'

+35 -1
+6
HISTORY.rst
··· 3 3 History 4 4 ------- 5 5 6 + 1.0a2 (2017-2-20) 7 + +++++++++++++++++ 8 + 9 + * Add search options to admin. 10 + * Export current options command. 11 + 6 12 1.0a1 (2017-2-20) 7 13 +++++++++++++++++ 8 14
+1 -1
options/__init__.py
··· 14 14 15 15 default_app_config = 'options.apps.ConfigurationsConfig' 16 16 17 - VERSION = (1, 0, 0, 'alpha', 1) 17 + VERSION = (1, 0, 0, 'alpha', 2) 18 18 19 19 __version__ = get_version(VERSION)
+1
options/admin.py
··· 11 11 """Manage configuration options.""" 12 12 13 13 list_display = ['public_name', 'value'] 14 + search_fields = ['public_name', 'name']
+2
options/management/__init__.py
··· 1 + # -*- coding: utf-8 -*- 2 + from __future__ import unicode_literals, print_function, division, absolute_import
+2
options/management/commands/__init__.py
··· 1 + # -*- coding: utf-8 -*- 2 + from __future__ import unicode_literals, print_function, division, absolute_import
+22
options/management/commands/export_options.py
··· 1 + # -*- coding: utf-8 -*- 2 + from __future__ import unicode_literals, print_function, division, absolute_import 3 + 4 + import json 5 + 6 + from django.core.management import BaseCommand 7 + 8 + from options.models import Option 9 + 10 + 11 + class Command(BaseCommand): 12 + help = "Export current options to JSON format." 13 + 14 + def handle(self, *args, **options): 15 + export = dict() 16 + for option in Option.objects.all(): 17 + export[option.name] = { 18 + "value": option.value, 19 + "type": option.type, 20 + "public_name": option.public_name 21 + } 22 + self.stdout.write(json.dumps(export, indent=4, sort_keys=True))
+1
setup.py
··· 22 22 name='django-simple-options', 23 23 version=version, 24 24 packages=[ 25 + 'options.management.commands', 25 26 'options.migrations', 26 27 'options', 27 28 ],