loaddata should issue a warning when attempting to load data using an unknown serialization format even when it is unspecified
|Reported by:||stevecrozz@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
"loaddata" will issue a warning when you specify the filename and extension of the fixtures (in an unknown format) you want to load as seen in the following example:
./manage.py loaddata myapp/fixtures/initial_data.yaml Problem installing fixture 'myapp/fixtures/initial_data': yaml is not a known serialization format.
"loaddata" has a less helpful message when you attempt to load data in an unknown format without specifying the file extension (the way syncdb does):
./manage.py loaddata myapp/fixtures/initial_data No fixtures found.
When the file myapp/fixtures/initial_data.yaml exists, and pyyaml is not installed, the warning message should be the same whether or not you specify the file extension. I'd argue that anyone attempting to load database fixtures by name (sans extension) when a file exists with the same name would want to see this kind of warning. Some applications rely on initial_data fixtures and any user who issues ./manage syncdb and expects initial_data to load automatically could be frustrated if they fail to notice the 'No fixtures found' message. A warning is more appropriate in this instance.
Change History (6)
comment:1 Changed 6 years ago by Alex
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted