Ticket #12291: loading.py.diff
File loading.py.diff, 1.1 KB (added by , 15 years ago) |
---|
-
django/db/models/loading.py
30 30 31 31 # -- Everything below here is only used when populating the cache -- 32 32 loaded = False, 33 handled = {},33 handled = [], 34 34 postponed = [], 35 35 nesting_level = 0, 36 36 write_lock = threading.RLock(), … … 67 67 Loads the app with the provided fully qualified name, and returns the 68 68 model module. 69 69 """ 70 self.handled[app_name] = None 70 if not app_name in self.handled: 71 self.handled.append(app_name) 71 72 self.nesting_level += 1 72 73 mod = __import__(app_name, {}, {}, ['models']) 73 74 self.nesting_level -= 1 … … 80 81 self.postponed.append(app_name) 81 82 return None 82 83 if mod.models not in self.app_store: 83 self.app_store[mod.models] = len(self.app_store)84 self.app_store[mod.models] = self.handled.index(app_name) 84 85 return mod.models 85 86 86 87 def app_cache_ready(self):