#22280: "Conflicting models in application" RuntimeError for same model with
different paths
------------------------------+--------------------------------------
     Reporter:  blueyed       |                    Owner:  nobody
         Type:  Bug           |                   Status:  closed
    Component:  Core (Other)  |                  Version:  master
     Severity:  Normal        |               Resolution:  needsinfo
     Keywords:  app-loading   |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------

Comment (by blueyed):

 > The current working directory is automatically added to PYTHONPATH.
 That does not appear to make a difference, since I tried it with from
 different directories.

 > You're doing import app.foo.bar somewhere.
 That does not appear to be the case.

 From my understanding, a relative import will just use the full package
 name always.

 In `register_model` it looks like follows: via the relative import
 (project/project/app/tests.py):

 > ('register_model', u'app', <class 'project.app.models.Person'>)

 And the later model appears as:

 > ('register_model', 'app', <class '__fake__.Person'>)

 This gets done via `ModelState.render`.

 When using `runserver` instead of `tests`, the model appears as:

 > ('register_model', 'app', <class 'app.models.Person'>)

 It gets setup via django/apps/config.py / `import_module` / INSTALLED_APPS
 then.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.2eae2f331505a8e3e3182a2317fa9b28%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to