On Wed, Jul 7, 2010 at 1:39 AM, maxweld <da...@maxwell.uk.net> wrote:
> Thanks Russ for the information.
>
> I am very interested in the new self.stdout and self.stderr feature of
> management.commands. I can see that this is implemented in trunk for
> some commands but not yet for others. I guess the others will come in
> time, although maybe I could help by contributing some changes. Is
> there a ticket or a discussion that explains the thinking here? I
> could not seem to find one.

This feature was implemented mostly as support for the testing system.
We're in the process of migrating from doctests to unittests; doctests
can easily check output (that's how they work!), but unittests need
more infrastructure.

The dumpdata and loaddata commands have been converted because they
are the commands that needed stdout comparisons for testing purposes.

> You mentioned that its possible to
>> programatically set them to be any other stream you want.
> How is this done? I could see no examples or documentation on this
> feature, but maybe I was looking in the wrong place.

The fixtures model test (in tests/modeltests/fixtures) shows how you
can programatically invoke dumpdata providing a custom stdout/stderr
handler. It's (lightly) documented in
howto/custom-management-commands. This documentation is something that
could be improved.

> Do you know if there is any idea of when this feature might be
> included in a release? Django 1.3? As I am interested in providing a
> generic facility to use Django on my virtual hosting provider's site,
> the idea of monkeypatching code is not interesting. I would rather
> contribute to a bringing forward the release date of the eventual
> solution.

This feature is in trunk, so it will be in Django 1.3; best estimate
for a release is late this year (approx December).  If you want to
help out, adapting the other admin commands to use self.stdout instead
of print would be a helpful contribution. I'm not aware of a ticket
specifically tracking this idea, so feel free to open a new ticket and
upload a patch.

Yours
Russ Magee %-)

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

Reply via email to