Ticket #13182: dumpdata-json.patch
File dumpdata-json.patch, 1.7 KB (added by , 15 years ago) |
---|
-
django/core/serializers/json.py
25 25 self.options.pop('stream', None) 26 26 self.options.pop('fields', None) 27 27 self.options.pop('use_natural_keys', None) 28 if self.options.get('indent', None): 29 # The default is (', ', ': '). To eliminate useless whitespaces 30 # after comma, the representation is changed to (',', ': ') only 31 # if indent is used 32 self.options['separators'] = (',', ': ') 33 28 34 simplejson.dump(self.objects, self.stream, cls=DjangoJSONEncoder, **self.options) 29 35 30 36 def getvalue(self): -
django/core/management/commands/dumpdata.py
24 24 args = '[appname ...]' 25 25 26 26 def handle(self, *app_labels, **options): 27 from django.db.models import get_app, get_apps, get_model s, get_model27 from django.db.models import get_app, get_apps, get_model 28 28 29 format = options.get('format', 'json')30 indent = options.get('indent', None)29 format = options.get('format', 'json') 30 indent = options.get('indent', None) 31 31 using = options.get('database', DEFAULT_DB_ALIAS) 32 32 connection = connections[using] 33 exclude = options.get('exclude', [])33 exclude = options.get('exclude', []) 34 34 show_traceback = options.get('traceback', False) 35 35 use_natural_keys = options.get('use_natural_keys', False) 36 36