mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
[soc2009/multidb] Fixed a problem with overzealous purging of contenttypes during syncdb. Patch from Russell Keith-Magee.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11933 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
39f69c016e
commit
5cf2bede96
@ -7,10 +7,10 @@ def update_contenttypes(app, created_models, verbosity=2, **kwargs):
|
||||
Creates content types for models in the given app, removing any model
|
||||
entries that no longer have a matching model class.
|
||||
"""
|
||||
ContentType.objects.clear_cache()
|
||||
content_types = list(ContentType.objects.filter(app_label=app.__name__.split('.')[-2]))
|
||||
app_models = get_models(app)
|
||||
db = kwargs['db']
|
||||
ContentType.objects.clear_cache()
|
||||
content_types = list(ContentType.objects.using(db).filter(app_label=app.__name__.split('.')[-2]))
|
||||
app_models = get_models(app)
|
||||
if not app_models:
|
||||
return
|
||||
for klass in app_models:
|
||||
|
Loading…
x
Reference in New Issue
Block a user