On Thu, Apr 16, 2009 at 11:03:33AM +0800, Russell Keith-Magee wrote:
> Loaddata doesn't take input from stdin - it loads files that are
> specified on the command line.
Thanks, Russell.
I should have read the documentation for the loaddata command more
closely, but this is quite counter-intuitive. Can someone tell me
what the rationale for this syntax is?
The built-in usage help shows that the filename argument (called a
fixture for reasons that I have not yet researched) is mandatory:
Usage: manage.py loaddata [options] fixture [fixture ...]
However, manage.py does not report an error when a fixture is not
specified:
$ ./manage.py loaddata
$ echo $?
0
Only when I bump the verbosity up from 0 to 2 is an error
reported, and the return code still indicates success:
$ ./manage.py loaddata --verbosity=1 ; echo $?
0
$ ./manage.py loaddata --verbosity=2 ; echo $?
No fixtures found.
0
This is pretty bad unless there's a preferred method of loading
data in a non-interactive manner.
Possibly-relevant tickets found with a search of the Django Trac
(for "manage.py loaddata") include:
#6724 (loaddata w/ errors displays no warnings or error in output)
closed as duplicate of #4499 (integrity error silently failing with
postgres and loaddata)
#4431 (manage.py loaddata should have better error reporting)
closed as fixed with r6936
#4371 (fixture loading fails silently in testcases)
closed as fixed with r7595
#10200 (loaddata command does not raise CommandError on errors)
new
--
Phil Mocek
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---