[Django] #22580: dumpdata don't work with sub app

6 views
Skip to first unread message

Django

unread,
May 5, 2014, 2:23:31 PM5/5/14
to django-...@googlegroups.com
#22580: dumpdata don't work with sub app
-------------------------------------+-------------------------------------
Reporter: Fabio Caritas | Owner: nobody
Barrionuevo da Luz <bnafta@…> | Status: new
Type: Uncategorized | Version: 1.6
Component: Core (Management | Keywords: dumpdata management
commands) | commands subapp
Severity: Normal | Has patch: 0
Triage Stage: Unreviewed | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
I use django-allauth. The django-allauth has a structure of sub apps.
I need to export data from some of the sub apps, although Django support
the sub apps, dumpdata command does not have support to this feature

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.

Django

unread,
May 5, 2014, 2:27:15 PM5/5/14
to django-...@googlegroups.com
#22580: dumpdata don't work with sub app
-------------------------------------+-------------------------------------
Reporter: Fabio Caritas | Owner: nobody
Barrionuevo da Luz <bnafta@…> | Status: closed
Type: Uncategorized | Version: 1.6
Component: Core (Management | Resolution: invalid
commands) | Triage Stage:
Severity: Normal | Unreviewed
Keywords: dumpdata management | Needs documentation: 0
commands subapp | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by carljm):

* 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>

Django

unread,
May 5, 2014, 2:40:22 PM5/5/14
to django-...@googlegroups.com
#22580: dumpdata don't work with sub app
-------------------------------------+-------------------------------------
Reporter: Fabio Caritas | Owner: nobody
Barrionuevo da Luz <bnafta@…> | Status: closed
Type: Uncategorized | Version: 1.6

Component: Core (Management | Resolution: invalid
commands) | Triage Stage:
Severity: Normal | Unreviewed
Keywords: dumpdata management | Needs documentation: 0
commands subapp | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

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>

Django

unread,
May 5, 2014, 2:44:54 PM5/5/14
to django-...@googlegroups.com
#22580: dumpdata don't work with sub app
-------------------------------------+-------------------------------------
Reporter: Fabio Caritas | Owner: nobody
Barrionuevo da Luz <bnafta@…> | Status: closed
Type: Uncategorized | Version: 1.6

Component: Core (Management | Resolution: invalid
commands) | Triage Stage:
Severity: Normal | Unreviewed
Keywords: dumpdata management | Needs documentation: 0
commands subapp | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages