From 9996158db467f9bef8243fcc36dc3602570e3613 Mon Sep 17 00:00:00 2001 From: Maxime Turcotte Date: Tue, 17 Jun 2014 19:07:54 -0400 Subject: Fixed #22835 -- Deprecated NoArgsCommand. --- docs/howto/custom-management-commands.txt | 8 ++++++-- docs/internals/deprecation.txt | 4 ++++ docs/releases/1.8.txt | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt index bb15597a34..c43af9672d 100644 --- a/docs/howto/custom-management-commands.txt +++ b/docs/howto/custom-management-commands.txt @@ -152,8 +152,8 @@ require a system-neutral string language (for which we use 'en-us'). If, for some reason, your custom management command needs to use a fixed locale different from 'en-us', you should manually activate and deactivate it in your -:meth:`~BaseCommand.handle` or :meth:`~NoArgsCommand.handle_noargs` method using -the functions provided by the I18N support code: +:meth:`~BaseCommand.handle` method using the functions provided by the I18N +support code: .. code-block:: python @@ -431,6 +431,10 @@ Rather than implementing :meth:`~BaseCommand.handle`, subclasses must implement .. class:: NoArgsCommand +.. deprecated:: 1.8 + + Use :class:`BaseCommand` instead, which takes no arguments by default. + A command which takes no arguments on the command line. Rather than implementing :meth:`~BaseCommand.handle`, subclasses must implement diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 82ffe4938f..39c42ae7bf 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -38,6 +38,10 @@ about each item can often be found in the release notes of two versions prior. * Support for :py:mod:`optparse` will be dropped for custom management commands (replaced by :py:mod:`argparse`). +* The class :class:`~django.core.management.NoArgsCommand` will be removed. Use + :class:`~django.core.management.BaseCommand` instead, which takes no arguments + by default. + .. _deprecation-removed-in-1.9: 1.9 diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 32de9ba631..54bfd2b2ea 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -471,3 +471,10 @@ to add custom arguments to commands has changed: instead of extending the :meth:`~django.core.management.BaseCommand.add_arguments` method and add arguments through ``argparse.add_argument()``. See :ref:`this example ` for more details. + +``django.core.management.NoArgsCommand`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The class :class:`~django.core.management.NoArgsCommand` is now deprecated and +will be removed in Django 2.0. Use :class:`~django.core.management.BaseCommand` +instead, which takes no arguments by default. -- cgit v1.3