#23305: Models that are imported on app's import time are invisible to
makemigrations when the application is relabeld
-------------------------------------+-------------------------------------
     Reporter:  rafalp               |                    Owner:
         Type:                       |  brycecaine
  Cleanup/optimization               |                   Status:  assigned
    Component:  Documentation        |                  Version:  1.7-rc-2
     Severity:  Normal               |               Resolution:
     Keywords:  afraid-to-commit     |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

 This is already documented further in that file: "*At this stage, your
 code shouldn't import any models!*"

 The problem isn't restricted to `my_app/__init__.py`; any model import
 triggered, even indirectly, by `my_app/__init__.py` or `my_app/apps.py`
 will have the same effect.

 This raises a PendingDeprecationWarning, which is silent by default, but
 which you may display by running `python -Wall`. In 1.8 it will raise a
 DeprecationWarning, which is loud by default, and in 1.9 it will raise an
 exception. So the silent failure only happens in 1.7.

--
Ticket URL: <https://code.djangoproject.com/ticket/23305#comment:20>
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/064.babb0418fe20ea204dac18e94690cd4f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to