From 21ea58b8ccf95798271157876d59d46dcc745b0d Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Mon, 4 Feb 2013 08:55:45 -0300 Subject: [PATCH] Enhanced docs and docctrings added in 869c9ba. Thanks Claude for the suggestion. --- django/core/management/base.py | 9 +++++---- docs/howto/custom-management-commands.txt | 14 +++++++------- docs/releases/1.6.txt | 13 +++++++------ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/django/core/management/base.py b/django/core/management/base.py index 9dc321a0613..bdaa5fa98a5 100644 --- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -151,10 +151,11 @@ class BaseCommand(object): Default value is ``False``. Make sure you know what you are doing if you decide to change the value - of this option in your custom command because many of them create - database content that is locale-sensitive (like permissions) and that - content shouldn't contain any translations so making the locale differ - from the de facto default 'en-us' can cause unintended effects. + of this option in your custom command if it creates database content + that is locale-sensitive and such content shouldn't contain any + translations (like it happens e.g. with django.contrim.auth + permissions) as making the locale differ from the de facto default + 'en-us' might cause unintended effects. This option can't be False when the can_import_settings option is set to False too because attempting to set the locale needs access to diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt index eba187bb375..bfcea64b49f 100644 --- a/docs/howto/custom-management-commands.txt +++ b/docs/howto/custom-management-commands.txt @@ -118,7 +118,7 @@ Management commands and locales =============================== By default, the :meth:`BaseCommand.execute` method sets the hardcoded 'en-us' -locale because most of the commands shipped with Django perform several tasks +locale because some commands shipped with Django perform several tasks (for example, user-facing content rendering and database population) that require a system-neutral string language (for which we use 'en-us'). @@ -237,11 +237,11 @@ All attributes can be set in your derived class and can be used in Default value is ``False``. Make sure you know what you are doing if you decide to change the value of - this option in your custom command because many of them create database - content that is locale-sensitive (like permissions) and that content - shouldn't contain any translations so making the locale differ from the de - facto default 'en-us' can cause unintended effects. See the `Management - commands and locales`_ section above for further details. + this option in your custom command if it creates database content that + is locale-sensitive and such content shouldn't contain any translations (like + it happens e.g. with django.contrim.auth permissions) as making the locale + differ from the de facto default 'en-us' might cause unintended effects. See + the `Management commands and locales`_ section above for further details. This option can't be ``False`` when the :data:`~BaseCommand.can_import_settings` option is set to ``False`` too @@ -250,7 +250,7 @@ All attributes can be set in your derived class and can be used in .. versionadded:: 1.6 - The ``leave_locale_alone`` option was added in Django 1.6. +The ``leave_locale_alone`` option was added in Django 1.6. Methods ------- diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt index acc273cef44..25deb693af9 100644 --- a/docs/releases/1.6.txt +++ b/docs/releases/1.6.txt @@ -39,13 +39,14 @@ Minor features ` can be provided at translation time rather than at definition time. -* For custom managemente commands: Validation of the presence of valid settings - in managements commands that ask for it by using the +* For custom management commands: Verification of the presence of valid + settings in commands that ask for it by using the :attr:`~django.core.management.BaseCommand.can_import_settings` internal - option is now performed independently from handling of the locale that should - active during the execution of the command. The latter can now be influenced - by the new :attr:`~django.core.management.BaseCommand.leave_locale_alone` - internal option. See :ref:`management-commands-and-locales` for more details. + option is now performed independently from handling of the locale that + should be active during the execution of the command. The latter can now be + influenced by the new + :attr:`~django.core.management.BaseCommand.leave_locale_alone` internal + option. See :ref:`management-commands-and-locales` for more details. Backwards incompatible changes in 1.6 =====================================