Changeset 7704
- Timestamp:
- 06/19/08 08:24:39 (3 months ago)
- Files:
-
- django/trunk/django/core/management/commands/syncdb.py (modified) (2 diffs)
- django/trunk/docs/django-admin.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/management/commands/syncdb.py
r7623 r7704 26 26 verbosity = int(options.get('verbosity', 1)) 27 27 interactive = options.get('interactive') 28 show_traceback = options.get('traceback', False) 28 29 29 30 self.style = no_style() … … 120 121 cursor.execute(sql) 121 122 except Exception, e: 122 sys.stderr.write("Failed to install custom SQL for %s.%s model: %s " % \123 sys.stderr.write("Failed to install custom SQL for %s.%s model: %s\n" % \ 123 124 (app_name, model._meta.object_name, e)) 125 if show_traceback: 126 import traceback 127 traceback.print_exc() 124 128 transaction.rollback_unless_managed() 125 129 else: 126 130 transaction.commit_unless_managed() 127 131 else: 132 if verbosity >= 2: 133 print "No custom SQL for %s.%s model" % (app_name, model._meta.object_name) 128 134 # Install SQL indicies for all newly created models 129 135 for app in models.get_apps(): django/trunk/docs/django-admin.txt
r7648 r7704 756 756 Note that this option is unnecessary in ``manage.py``, because it uses 757 757 ``settings.py`` from the current project by default. 758 759 --traceback 760 ----------- 761 762 Example usage:: 763 764 django-admin.py syncdb --traceback 765 766 By default, ``django-admin.py`` will show a simple error message whenever an 767 error occurs. If you specify ``--traceback``, ``django-admin.py`` will 768 output a full stack trace whenever an exception is raised. 758 769 759 770 Extra niceties
