Ticket #4431: 4431.diff
File 4431.diff, 3.0 KB (added by , 17 years ago) |
---|
-
django/core/management/commands/dumpdata.py
18 18 19 19 format = options.get('format', 'json') 20 20 indent = options.get('indent', None) 21 show_traceback = options.get('traceback', False) 21 22 22 23 if len(app_labels) == 0: 23 24 app_list = get_apps() … … 38 39 try: 39 40 return serializers.serialize(format, objects, indent=indent) 40 41 except Exception, e: 42 if show_traceback: 43 raise 41 44 raise CommandError("Unable to serialize database: %s" % e) -
django/core/management/commands/loaddata.py
27 27 self.style = no_style() 28 28 29 29 verbosity = int(options.get('verbosity', 1)) 30 show_traceback = options.get('traceback', False) 30 31 31 32 # Keep a count of the installed objects and fixtures 32 33 count = [0, 0] … … 98 99 label_found = True 99 100 except Exception, e: 100 101 fixture.close() 102 transaction.rollback() 103 transaction.leave_transaction_management() 104 if show_traceback: 105 raise 101 106 sys.stderr.write( 102 107 self.style.ERROR("Problem installing fixture '%s': %s\n" % 103 108 (full_path, str(e)))) 104 transaction.rollback()105 transaction.leave_transaction_management()106 109 return 107 110 fixture.close() 108 111 except: 112 if show_traceback: 113 raise 109 114 if verbosity > 1: 110 115 print "No %s fixture '%s' in %s." % \ 111 116 (format, fixture_name, humanize(fixture_dir)) -
django/core/management/base.py
27 27 help='The Python path to a settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.'), 28 28 make_option('--pythonpath', 29 29 help='A directory to add to the Python path, e.g. "/home/djangoprojects/myproject".'), 30 make_option('--traceback', action='store_true', 31 help='Print traceback on exception'), 30 32 ) 31 33 help = '' 32 34 args = ''