Ticket #13335: 13335.diff
File 13335.diff, 1.3 KB (added by , 15 years ago) |
---|
-
django/db/models/loading.py
75 75 app_module = import_module(app_name) 76 76 try: 77 77 imp.find_module('models', app_module.__path__) 78 except ImportError: 79 self.nesting_level -= 1 80 # App has no models module, that's not a problem. 81 return None 82 try: 83 models = import_module('.models', app_name) 78 84 except ImportError: 79 85 self.nesting_level -= 1 80 86 if can_postpone: 81 # Either the app has no models, or the package is still being87 # Either the app has an error, or the package is still being 82 88 # imported by Python and the model module isn't available yet. 83 89 # We will check again once all the recursion has finished (in 84 90 # populate). 85 91 self.postponed.append(app_name) 86 return None 87 models = import_module('.models', app_name) 92 return None 93 else: 94 raise 88 95 self.nesting_level -= 1 89 96 if models not in self.app_store: 90 97 self.app_store[models] = len(self.app_store)