Gotcha in apps and migrations handling?

63 views
Skip to first unread message

Rafał Pitoń

unread,
Aug 16, 2014, 5:15:02 PM8/16/14
to django-d...@googlegroups.com
I have noticed something today as I've added AppConfig to my app:

This app at top of its __init__.py imports module "api.py" which in turn imports models "Notification" from models.py.

When I fire "makemigrations myapp_label", it claims no changes where made, which obviously is false. I have model in models.py that needs to have migration added. When I comment out model import in api.py, migration gets created successfully.

For sake of double check I've did similiar in other app: made model imported on apps import time and same thing happened: my model became invisible to makemigration.

When I remove AppConfig from app, models become visible to makemigration again.

Is this intented behaviour or bug?

Andrew Godwin

unread,
Aug 16, 2014, 5:29:37 PM8/16/14
to django-d...@googlegroups.com

It's not intended behaviour, it might be a bug with app loading or migrations or it might just be a circular import issue.

Could you open a ticket with your test case on the Trac?

Andrew

--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/c677b832-dbe5-4361-a27f-1ae1c87a496f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rafał Pitoń

unread,
Aug 16, 2014, 6:04:00 PM8/16/14
to django-d...@googlegroups.com
To triple check, I've created empty app and and it still fails. I've opened trac ticket:

Reply all
Reply to author
Forward
0 new messages