From 1845bc1d1007751a7f65c66aeddc35f032f6bf41 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Wed, 2 Mar 2016 18:01:36 -0800 Subject: Refs #26315 -- Cleaned up argparse options in commands. * Removed type coercion. Options created by argparse are already coerced to the correct type. * Removed fallback default values. Options created by argparse already have a default value. * Used direct indexing. Options created by argparse are always set. This eliminates the need to use dict.get(). --- docs/releases/1.10.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs') diff --git a/docs/releases/1.10.txt b/docs/releases/1.10.txt index 0d1ea5b5d2..e19ecf5662 100644 --- a/docs/releases/1.10.txt +++ b/docs/releases/1.10.txt @@ -640,6 +640,14 @@ Miscellaneous * Tests that violate deferrable database constraints will now error when run on a database that supports deferrable constraints. +* Built-in management commands now use indexing of keys in ``options``, e.g. + ``options['verbosity']``, instead of ``options.get()`` and no longer perform + any type coercion. This could be a problem if you're calling commands using + ``Command.execute()`` (which bypasses the argument parser that sets a default + value) instead of :func:`~django.core.management.call_command`. Instead of + calling ``Command.execute()``, pass the command object as the first argument + to ``call_command()``. + .. _deprecated-features-1.10: Features deprecated in 1.10 -- cgit v1.3