Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved error handling for management.py commands, especially for no…
… argument or non-applabel argument commands. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5903 bcc190cf-cafb-0310-a4f2-bffc1f526a37
- Loading branch information
1 parent
c568792
commit 83f5f70
Showing
13 changed files
with
119 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from django.core.management.base import BaseCommand | ||
from django.core.management.base import NoArgsCommand | ||
|
||
class Command(BaseCommand): | ||
class Command(NoArgsCommand): | ||
help = "Runs the command-line client for the current DATABASE_ENGINE." | ||
|
||
requires_model_validation = False | ||
|
||
def handle(self, **options): | ||
def handle_noargs(self, **options): | ||
from django.db import runshell | ||
runshell() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from django.core.management.base import BaseCommand | ||
from django.core.management.base import NoArgsCommand | ||
|
||
class Command(BaseCommand): | ||
class Command(NoArgsCommand): | ||
help = "Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed." | ||
|
||
output_transaction = True | ||
|
||
def handle(self, **options): | ||
def handle_noargs(self, **options): | ||
from django.core.management.sql import sql_flush | ||
return '\n'.join(sql_flush(self.style)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from django.core.management.base import BaseCommand | ||
from django.core.management.base import NoArgsCommand | ||
|
||
class Command(BaseCommand): | ||
class Command(NoArgsCommand): | ||
help = "Validates all installed models." | ||
|
||
requires_model_validation = False | ||
|
||
def handle(self, **options): | ||
def handle_noargs(self, **options): | ||
self.validate() |