mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #22835 -- Deprecated NoArgsCommand.
This commit is contained in:
parent
63670a474c
commit
9996158db4
20 changed files with 94 additions and 69 deletions
|
@ -1,9 +1,9 @@
|
|||
from django.core.management.base import NoArgsCommand
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
class Command(BaseCommand):
|
||||
help = "Test color output"
|
||||
requires_system_checks = False
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
def handle(self, **options):
|
||||
return self.style.SQL_KEYWORD('BEGIN')
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from django.core.management.base import NoArgsCommand
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
class Command(BaseCommand):
|
||||
help = "Test No-args commands"
|
||||
requires_system_checks = False
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
print('EXECUTE:NoArgsCommand options=%s' % sorted(options.items()))
|
||||
def handle(self, **options):
|
||||
print('EXECUTE: noargs_command options=%s' % sorted(options.items()))
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
from django.core.management.base import NoArgsCommand
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class InvalidCommand(NoArgsCommand):
|
||||
class InvalidCommand(BaseCommand):
|
||||
help = ("Test raising an error if both requires_system_checks "
|
||||
"and requires_model_validation are defined.")
|
||||
requires_system_checks = True
|
||||
requires_model_validation = True
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
def handle(self, **options):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue