Ticket #19749: 19749-1.diff

File 19749-1.diff, 1.4 KB (added by Claude Paroz, 12 years ago)
  • docs/howto/custom-management-commands.txt

    diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
    index bfcea64..ae7127c 100644
    a b look like this:  
    7070    output, you should write to ``self.stdout`` and ``self.stderr``,
    7171    instead of printing to ``stdout`` and ``stderr`` directly. By
    7272    using these proxies, it becomes much easier to test your custom
    73     command.
     73    command. Note also that you don't need to end messages with a newline
     74    character, it will be added automatically.
    7475
    7576The new custom command can be called using ``python manage.py closepoll
    7677<poll_id>``.
  • docs/releases/1.5.txt

    diff --git a/docs/releases/1.5.txt b/docs/releases/1.5.txt
    index a5ce08a..d85ca00 100644
    a b Django 1.5 also includes several smaller improvements worth noting:  
    253253  from :ref:`call_command <call-command>`. Any exception raised by the command
    254254  (mostly :ref:`CommandError <ref-command-exceptions>`) is propagated.
    255255
     256  Moreover, when you output errors or messages in your custom commands, you
     257  should now use ``self.stdout.write('message')`` and
     258  ``self.stderr.write('error')`` (newline will be added automatically).
     259
    256260* The dumpdata management command outputs one row at a time, preventing
    257261  out-of-memory errors when dumping large datasets.
    258262
Back to Top