#27365: Fields suddenly not found.
-------------------------------------+-------------------------------------
     Reporter:  Brandon              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.9
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  FieldDoesNotExist    |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Aymeric Augustin):

 > Every model that is being used is beneath a package that is listed in
 `INSTALLED_APPS`.

 This is good. If I may ask a more precise question:
 - are all your models in simple `models.py` module? or do you have a
 `models/__init__.py` package with `models/cases.py`, etc. submodules?
 - if the latter are you importing all your models in `__init__.py`? If
 not, that could solve your problem.

 You mention `__import__`. Did you mean `import`? Or do you really use the
 low level `__import__`? Could you try using `apps.get_models` instead?
 `apps.get_models` is intended to raise an exception in situations that may
 lead to such inconsistencies.

--
Ticket URL: <https://code.djangoproject.com/ticket/27365#comment:5>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/088.9653ee60d6a634dc4036e1db66480569%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to