Ticket #4193: 4193_model_registry_fix.diff
File 4193_model_registry_fix.diff, 927 bytes (added by , 17 years ago) |
---|
-
django/db/models/loading.py
2 2 3 3 from django.conf import settings 4 4 from django.core.exceptions import ImproperlyConfigured 5 from django.utils.datastructures import SortedDict 5 6 import sys 6 7 import os 7 8 import threading … … 159 160 # Store as 'name: model' pair in a dictionary 160 161 # in the _app_models dictionary 161 162 model_name = model._meta.object_name.lower() 162 model_dict = self.app_models.setdefault(app_label, {})163 model_dict = self.app_models.setdefault(app_label, SortedDict()) 163 164 if model_name in model_dict: 164 165 # The same model may be imported via different paths (e.g. 165 166 # appname.models and project.appname.models). We use the source