Hello.

There is a huge issue with content types framework. The data is loaded 
after every migration (post_migrate signal) automatically, and this 
approach is against db data consistency.
The biggest problem is with data migrations, which are applied at the first 
time (on clean database). Any data migration which depends on some content 
types will not insert the data.

The sequence looks like this:

   1. create db
   2. insert into auth_permission ...  inner join django_content_type ...
   3. post migrate: insert into django_content_type ...


Two things are wrong:

   - automatic creation of content types
   - creation of content types after running migrations

Solution:

   - creation of new app should add very first migration, which will add 
   entry to the content types
   - create_contentypes handler should be removed from post_migrate signal

Any data migration, which depends on some content types, should be declared 
with proper dependency. This will guarantee existence of the required 
content type entry.


BR,
Marcin


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/8869b1cb-2b92-4e05-823a-92e72308fc23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to