[Django] #25561: dumpdata command cannot understand a dotted app name though INSTALLED_APPS allows it.

9 views
Skip to first unread message

Django

unread,
Oct 16, 2015, 6:29:56 PM10/16/15
to django-...@googlegroups.com
#25561: dumpdata command cannot understand a dotted app name though INSTALLED_APPS
allows it.
----------------------------+----------------------
Reporter: tyrdare | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.7
Severity: Normal | Keywords: dumpdata
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+----------------------
python3 manage.py dumpdata 'ers_database.c3rs' > test_mapper.json
CommandError: Unknown model: ers_database.c3rs

c3rs is a submodule of the ers_database module and has its own models.py

--
Ticket URL: <https://code.djangoproject.com/ticket/25561>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 16, 2015, 6:35:38 PM10/16/15
to django-...@googlegroups.com
#25561: dumpdata command cannot understand a dotted app name though INSTALLED_APPS
allows it.
---------------------------+--------------------------------------

Reporter: tyrdare | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.7
Severity: Normal | Resolution:

Keywords: dumpdata | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------+--------------------------------------
Changes (by tyrdare):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

also, ers_database has its own models.py.

Database router in use, both models.py utilize the router and use the same
app_label. Migrations work.

'python3 manage.py dumpdata ers_database' produces a zero-length file
though there is data in the database.

Database type is postgresql

--
Ticket URL: <https://code.djangoproject.com/ticket/25561#comment:1>

Django

unread,
Oct 17, 2015, 2:20:08 PM10/17/15
to django-...@googlegroups.com
#25561: dumpdata command cannot understand a dotted app name though INSTALLED_APPS
allows it.
---------------------------+--------------------------------------

Reporter: tyrdare | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.7
Severity: Normal | Resolution:

Keywords: dumpdata | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------+--------------------------------------

Comment (by timgraham):

I'm not sure this is a supported configuration of models. Can you provide
a sample app for better clarity?

Please see #25127 for a documentation request about how to define models
in multiple modules which may be relevant.

--
Ticket URL: <https://code.djangoproject.com/ticket/25561#comment:2>

Django

unread,
Oct 17, 2015, 4:36:00 PM10/17/15
to django-...@googlegroups.com
#25561: dumpdata command cannot understand a dotted app name though INSTALLED_APPS
allows it.
---------------------------+--------------------------------------

Reporter: tyrdare | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.7
Severity: Normal | Resolution:

Keywords: dumpdata | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------+--------------------------------------

Comment (by tyrdare):

I'll attempt to put together a representative case.

Thanks for the reference link.

--
Ticket URL: <https://code.djangoproject.com/ticket/25561#comment:3>

Django

unread,
Oct 17, 2015, 6:52:50 PM10/17/15
to django-...@googlegroups.com
#25561: dumpdata command cannot understand a dotted app name though INSTALLED_APPS
allows it.
---------------------------+--------------------------------------

Reporter: tyrdare | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.7
Severity: Normal | Resolution:

Keywords: dumpdata | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------+--------------------------------------

Comment (by tyrdare):

I was able to reproduce the issue in sample I ginned up, which mimics the
same db architecture and module/submodule layout as the system I
encountered the problem on. However, in the process of working with my
sample, I came to realize that the dumpdata command works with the
app_labels of the models and that using

{{{
manage.py dumpdata app_label.ModelClassName
}}}

(where the model is in the models.py of the submodule) works just fine and
that I was doing it wrong on the original system.

When I ran into difficulties I was trying to do a

{{{
manage.py dumpdata app_label.subapp_label
}}}
which dumpdata reasonably considered to be a class
and
{{{
manage.py dumpdata app_label.subapp_label.ModelClassName'
}}}
which it considered to be an app

Please close as not a bug.

--
Ticket URL: <https://code.djangoproject.com/ticket/25561#comment:4>

Django

unread,
Oct 17, 2015, 6:53:58 PM10/17/15
to django-...@googlegroups.com
#25561: dumpdata command cannot understand a dotted app name though INSTALLED_APPS
allows it.
---------------------------+--------------------------------------
Reporter: tyrdare | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 1.7
Severity: Normal | Resolution: invalid

Keywords: dumpdata | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------+--------------------------------------
Changes (by tyrdare):

* status: new => closed
* resolution: => invalid


--
Ticket URL: <https://code.djangoproject.com/ticket/25561#comment:5>

Reply all
Reply to author
Forward
0 new messages