Ticket #2232: recursive-import-fix.diff
File recursive-import-fix.diff, 1.3 KB (added by , 18 years ago) |
---|
-
django/db/models/base.py
9 9 from django.db.models.options import Options, AdminOptions 10 10 from django.db import connection, backend, transaction 11 11 from django.db.models import signals 12 from django.db.models.loading import register_models 12 from django.db.models.loading import register_models, get_model 13 13 from django.dispatch import dispatcher 14 14 from django.utils.datastructures import SortedDict 15 15 from django.utils.functional import curry … … 60 60 new_class._prepare() 61 61 62 62 register_models(new_class._meta.app_label, new_class) 63 return new_class63 return get_model(new_class._meta.app_label, name) 64 64 65 65 class Model(object): 66 66 __metaclass__ = ModelBase -
django/db/models/loading.py
73 73 Returns the model matching the given app_label and case-insensitive model_name. 74 74 Returns None if no model is found. 75 75 """ 76 get_apps() # Run get_apps() to populate the _app_list cache. Slightly hackish.77 76 try: 78 77 model_dict = _app_models[app_label] 79 78 except KeyError: