Author: russellm Date: 2010-06-21 07:01:37 -0500 (Mon, 21 Jun 2010) New Revision: 13364
Modified: django/branches/releases/1.2.X/docs/howto/custom-management-commands.txt Log: [1.2.X] Fixed #13747 -- Reverted documentation suggesting the use of self.stdout/err in management commands in 1.2. Thanks to metamemetics for the report. Strictly, self.stdout/err is a feature addition; however, it's a feature that is required in order to achieve a massive speedup in the tests and to maintain parity between 1.2.X and trunk tests. However, the feature is completely transparent -- the old technique will work fine, it just isn't as testable. Therefore, we'll treat this as an undocumented feature in the 1.2 branch. Modified: django/branches/releases/1.2.X/docs/howto/custom-management-commands.txt =================================================================== --- django/branches/releases/1.2.X/docs/howto/custom-management-commands.txt 2010-06-21 11:48:45 UTC (rev 13363) +++ django/branches/releases/1.2.X/docs/howto/custom-management-commands.txt 2010-06-21 12:01:37 UTC (rev 13364) @@ -62,15 +62,8 @@ poll.opened = False poll.save() - self.stdout.write('Successfully closed poll "%s"\n' % poll_id) + print 'Successfully closed poll "%s"' % poll_id -.. note:: - When you are using management commands and wish to provide console - output, you should write to ``self.stdout`` and ``self.stderr``, - instead of printing to ``stdout`` and ``stderr`` directly. By - using these proxies, it becomes much easier to test your custom - command. - The new custom command can be called using ``python manage.py closepoll <poll_id>``. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@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.