Ticket #17799: 17799-2.diff

File 17799-2.diff, 1.2 KB (added by Claude Paroz, 12 years ago)

Doc updated with note about execute

  • docs/howto/custom-management-commands.txt

    diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
    index e49e2b6..74b67b2 100644
    a b the :meth:`~BaseCommand.handle` method must be implemented.  
    243243    :class:`CommandError`, intercept it and print it sensibly to
    244244    stderr.
    245245
     246.. admonition:: Calling a management command in your code
     247
     248    ``execute()`` should not be called directly from your code to execute a
     249    command. Use :ref:`call_command <call-command>` instead.
     250
    246251.. method:: BaseCommand.handle(*args, **options)
    247252
    248253    The actual logic of the command. Subclasses must implement this method.
  • docs/ref/django-admin.txt

    diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
    index 40b5ee1..bd99958 100644
    a b See :doc:`/howto/custom-management-commands` for how to add customized actions.  
    14901490Running management commands from your code
    14911491==========================================
    14921492
     1493.. _call-command:
     1494
    14931495.. function:: django.core.management.call_command(name, *args, **options)
    14941496
    14951497To call a management command from code use ``call_command``.
Back to Top