Author: carljm
Date: 2012-03-02 09:13:53 -0800 (Fri, 02 Mar 2012)
New Revision: 17629

Modified:
   django/trunk/docs/howto/custom-management-commands.txt
   django/trunk/docs/ref/django-admin.txt
Log:
Fixed #17799 - Documented that the execute() method of a management command is 
not suitable for calling the command from code; call_command should be used 
instead. Thanks kacah222 for the report and claudep for the patch.

Modified: django/trunk/docs/howto/custom-management-commands.txt
===================================================================
--- django/trunk/docs/howto/custom-management-commands.txt      2012-03-02 
16:56:20 UTC (rev 17628)
+++ django/trunk/docs/howto/custom-management-commands.txt      2012-03-02 
17:13:53 UTC (rev 17629)
@@ -243,6 +243,11 @@
     :class:`CommandError`, intercept it and print it sensibly to
     stderr.
 
+.. admonition:: Calling a management command in your code
+
+    ``execute()`` should not be called directly from your code to execute a
+    command. Use :ref:`call_command <call-command>` instead.
+
 .. method:: BaseCommand.handle(*args, **options)
 
     The actual logic of the command. Subclasses must implement this method.

Modified: django/trunk/docs/ref/django-admin.txt
===================================================================
--- django/trunk/docs/ref/django-admin.txt      2012-03-02 16:56:20 UTC (rev 
17628)
+++ django/trunk/docs/ref/django-admin.txt      2012-03-02 17:13:53 UTC (rev 
17629)
@@ -1490,6 +1490,8 @@
 Running management commands from your code
 ==========================================
 
+.. _call-command:
+
 .. function:: django.core.management.call_command(name, *args, **options)
 
 To call a management command from code use ``call_command``.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to