1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Changed 'validate' and 'runserver' management commands to display the number of errors. This was previous behavior before the management.py refactoring

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6022 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2007-08-27 00:30:37 +00:00
parent 4ea2afa4d5
commit 44e620972d
3 changed files with 5 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ class BaseCommand(object):
sys.stderr.write(self.style.ERROR(str('Error: %s\n' % e)))
sys.exit(1)
def validate(self, app=None):
def validate(self, app=None, display_num_errors=False):
"""
Validates the given app, raising CommandError for any errors.
@@ -61,6 +61,8 @@ class BaseCommand(object):
s.seek(0)
error_text = s.read()
raise CommandError("One or more models did not validate:\n%s" % error_text)
if display_num_errors:
print "%s error%s found" % (num_errors, num_errors != 1 and 's' or '')
def handle(self, *args, **options):
raise NotImplementedError()