Ticket #17037: django_manage_py_diffsettings_all_v2.diff
File django_manage_py_diffsettings_all_v2.diff, 1.3 KB (added by , 13 years ago) |
---|
-
django/core/management/commands/diffsettings.py
1 from optparse import make_option 2 1 3 from django.core.management.base import NoArgsCommand 2 4 3 5 def module_to_dict(module, omittable=lambda k: k.startswith('_')): … … 9 11 default settings. Settings that don't appear in the defaults are 10 12 followed by "###".""" 11 13 14 option_list = NoArgsCommand.option_list + ( 15 make_option('--all', action='store_true', dest='all', 16 default=False, help='Display all settings; not just ones ' 17 'that differ from Django defaults. Settings that equal ' 18 'the defaults are prefixed with "# (Default)".'), 19 ) 20 12 21 requires_model_validation = False 13 22 14 23 def handle_noargs(self, **options): … … 29 38 output.append("%s = %s ###" % (key, user_settings[key])) 30 39 elif user_settings[key] != default_settings[key]: 31 40 output.append("%s = %s" % (key, user_settings[key])) 41 elif options.get('all', False): 42 output.append("# (Default) %s = %s" % (key, user_settings[key])) 32 43 return '\n'.join(output)