Author: Alex
Date: 2009-12-21 13:31:13 -0600 (Mon, 21 Dec 2009)
New Revision: 11933

Modified:
   django/branches/soc2009/multidb/django/contrib/contenttypes/management.py
Log:
[soc2009/multidb] Fixed a problem with overzealous purging of contenttypes 
during syncdb.  Patch from Russell Keith-Magee.

Modified: 
django/branches/soc2009/multidb/django/contrib/contenttypes/management.py
===================================================================
--- django/branches/soc2009/multidb/django/contrib/contenttypes/management.py   
2009-12-21 19:31:05 UTC (rev 11932)
+++ django/branches/soc2009/multidb/django/contrib/contenttypes/management.py   
2009-12-21 19:31:13 UTC (rev 11933)
@@ -7,10 +7,10 @@
     Creates content types for models in the given app, removing any model
     entries that no longer have a matching model class.
     """
+    db = kwargs['db']
     ContentType.objects.clear_cache()
-    content_types = 
list(ContentType.objects.filter(app_label=app.__name__.split('.')[-2]))
+    content_types = 
list(ContentType.objects.using(db).filter(app_label=app.__name__.split('.')[-2]))
     app_models = get_models(app)
-    db = kwargs['db']
     if not app_models:
         return
     for klass in app_models:

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to