Ticket #1812: loading-getapp.diff
File loading-getapp.diff, 804 bytes (added by , 19 years ago) |
---|
-
django/db/models/loading.py
26 26 "Returns the module containing the models for the given app_label." 27 27 for app_name in settings.INSTALLED_APPS: 28 28 if app_label == app_name.split('.')[-1]: 29 return __import__(app_name, '', '', ['models']).models 29 try: 30 return __import__(app_name, '', '', ['models']).models 31 except AttributeError: 32 raise ImproperlyConfigured, "Models for app with label %s could not be found" % app_label 30 33 raise ImproperlyConfigured, "App with label %s could not be found" % app_label 31 34 32 35 def get_models(app_mod=None):