1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

Seed the global app cache in a call to db.models.get_model() except when we are

constructing a model class. Refs #2348.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2006-07-29 21:04:41 +00:00
parent 1a3b112610
commit 9e957485bd
2 changed files with 8 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ class ModelBase(type):
new_class._meta.app_label = model_module.__name__.split('.')[-2]
# Bail out early if we have already created this class.
m = get_model(new_class._meta.app_label, name)
m = get_model(new_class._meta.app_label, name, False)
if m is not None:
return m
@@ -68,7 +68,7 @@ class ModelBase(type):
# the first class for this model to register with the framework. There
# should only be one class for each model, so we must always return the
# registered version.
return get_model(new_class._meta.app_label, name)
return get_model(new_class._meta.app_label, name, False)
class Model(object):
__metaclass__ = ModelBase