summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-01-17 12:59:07 -0500
committerTim Graham <timograham@gmail.com>2015-01-17 12:59:07 -0500
commit4a03d348c70caa3e21393e08e6e665ef752202ac (patch)
treec7bc66eba84227a1130c1c18f5aabb18e72acf9b /django
parent18192b9fa4387d5e6c677a7929d91ce04f92cda7 (diff)
Removed BaseCommand.requires_model_validation per deprecation timeline.
Diffstat (limited to 'django')
-rw-r--r--django/core/management/base.py45
1 files changed, 3 insertions, 42 deletions
diff --git a/django/core/management/base.py b/django/core/management/base.py
index f2301eef37..2777d4109e 100644
--- a/django/core/management/base.py
+++ b/django/core/management/base.py
@@ -191,18 +191,6 @@ class BaseCommand(object):
is the list of application's configuration provided by the
app registry.
- ``requires_model_validation``
- DEPRECATED - This value will only be used if requires_system_checks
- has not been provided. Defining both ``requires_system_checks`` and
- ``requires_model_validation`` will result in an error.
-
- A boolean; if ``True``, validation of installed models will be
- performed prior to executing the command. Default value is
- ``True``. To validate an individual application's models
- rather than all applications' models, call
- ``self.validate(app_config)`` from ``handle()``, where ``app_config``
- is the application's configuration provided by the app registry.
-
``leave_locale_alone``
A boolean indicating whether the locale set in settings should be
preserved during the execution of the command instead of translations
@@ -230,11 +218,7 @@ class BaseCommand(object):
can_import_settings = True
output_transaction = False # Whether to wrap the output in a "BEGIN; COMMIT;"
leave_locale_alone = False
-
- # Uncomment the following line of code after deprecation plan for
- # requires_model_validation comes to completion:
- #
- # requires_system_checks = True
+ requires_system_checks = True
def __init__(self, stdout=None, stderr=None, no_color=False):
self.stdout = OutputWrapper(stdout or sys.stdout)
@@ -245,29 +229,6 @@ class BaseCommand(object):
self.style = color_style()
self.stderr.style_func = self.style.ERROR
- # `requires_model_validation` is deprecated in favor of
- # `requires_system_checks`. If both options are present, an error is
- # raised. Otherwise the present option is used. If none of them is
- # defined, the default value (True) is used.
- has_old_option = hasattr(self, 'requires_model_validation')
- has_new_option = hasattr(self, 'requires_system_checks')
-
- if has_old_option:
- warnings.warn(
- '"requires_model_validation" is deprecated '
- 'in favor of "requires_system_checks".',
- RemovedInDjango19Warning)
- if has_old_option and has_new_option:
- raise ImproperlyConfigured(
- 'Command %s defines both "requires_model_validation" '
- 'and "requires_system_checks", which is illegal. Use only '
- '"requires_system_checks".' % self.__class__.__name__)
-
- self.requires_system_checks = (
- self.requires_system_checks if has_new_option else
- self.requires_model_validation if has_old_option else
- True)
-
@property
def use_argparse(self):
return not bool(self.option_list)
@@ -404,8 +365,8 @@ class BaseCommand(object):
def execute(self, *args, **options):
"""
Try to execute this command, performing system checks if needed (as
- controlled by attributes ``self.requires_system_checks`` and
- ``self.requires_model_validation``, except if force-skipped).
+ controlled by the ``requires_system_checks`` attribute, except if
+ force-skipped).
"""
if options.get('no_color'):
self.style = no_style()