Hi all, 
I noticed that with multiple databases, the content_type tables are not 
filled in the same way. It is not a bug, but having uniform content type 
tables through multiple databases makes life easier.

If 'django.contrib.contenttypes' app comes before 'django.contrib.auth' in 
INSTALLED_APPS
the content_type table is filled 
here: 
https://github.com/django/django/blob/1.8.9/django/contrib/contenttypes/management.py#L53
 

else (only in the database where 'auth' is migrated, previous method for 
the other databases)
it is filled by the method get_for_model() 
https://github.com/django/django/blob/1.8.9/django/contrib/contenttypes/models.py#L69
called in the 'django.contrib.auth' signal handler: 
https://github.com/django/django/blob/1.8.9/django/contrib/auth/management/__init__.py#L82


For the moment I adopted this solution (don't know if it is the best): 
'contenttypes' before 'auth' in INSTALLED_APPS
and this little modif using sorted() 
method: 
https://github.com/mariuccio/django/blob/stable/1.8.x/django/contrib/contenttypes/management.py#L50


Thanks for any advice,
Mario

-- 
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/78ec3bb3-a0d9-4451-a3a0-cf3e6806eaa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to