Ticket #12360: load_app-importerror.patch

File load_app-importerror.patch, 722 bytes (added by dmach, 15 years ago)
  • django/db/models/loading.py

     
    7070        """
    7171        self.handled[app_name] = None
    7272        self.nesting_level += 1
    73         try:
    74             models = import_module('.models', app_name)
    75         except ImportError:
     73        app_module = __import__(app_name, {}, {}, ["models"])
     74        if hasattr(app_module, "models"):
     75            models = getattr(app_module, "models")
     76        else:
    7677            self.nesting_level -= 1
    7778            if can_postpone:
    7879                # Either the app has no models, or the package is still being
Back to Top