I have the following structure of directories:
django_project:
manage.py
test_dumpdata_subapp:
__init__.py
settings.py
...
normalapp:
__init__.py
models.py
...
subapp:
__init__.py
models.py
...
submodule:
__init__.py
anothersubapp:
__init__.py
models.py
...
On settings.py file:
INSTALLED_APPS = (
...
'normalapp',
'normalapp.subapp',
'normalapp.subapp.submodule.anothersubapp',
)
syncdb works perfectly, but try:
python manage.py dumpdata normalapp normalapp.subapp
normalapp.subapp.submodule.anothersubapp
results in this:
CommandError: Unknown model: normalapp.subapp
My test project is attached or can be viewed on github:
https://github.com/luzfcb/test_dumpdata_subapp
--
Ticket URL: <https://code.djangoproject.com/ticket/22580>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
The app-label for a "subapp" (for any app, really) is just the leaf
package name, not the full dotted import path. So you should be running
`python manage.py dumpdata normalapp subapp anothersubapp`.
--
Ticket URL: <https://code.djangoproject.com/ticket/22580#comment:1>
Comment (by Fabio Caritas Barrionuevo da Luz <bnafta@…>):
Thank's.
I'm not speaking english language, use google translator for almost
everything (I'm still learning). So it was not very clear to me.
It is possible to include an explicit note about it in the documentation
and/or help of the dumpdata command?
--
Ticket URL: <https://code.djangoproject.com/ticket/22580#comment:2>
Comment (by carljm):
Many management commands accept app labels, so it doesn't make sense to
document this specifically for dumpdata. It seems like the 1.6 docs don't
include a clear definition of "app label" (that I can find); however, this
has already been addressed for 1.7 in
https://docs.djangoproject.com/en/dev/ref/applications/
--
Ticket URL: <https://code.djangoproject.com/ticket/22580#comment:3>