• Aymeric Augustin's avatar
    Added get_app_config() to look up app configs by label. · a4cb1400
    Aymeric Augustin yazdı
    Refactored get_app() to rely on that method.
    
    get_app() starts by calling _populate(), which goes through
    INSTALLED_APPS and, for each app, imports the app module and attempts to
    import the models module. At this point, no further imports are
    necessary to return the models module for a  given app. Therefore, the
    implementation of get_app() can be simplified and the safeguards for
    race conditions can be removed.
    
    Besides, the emptyOK parameter isn't used anywhere in Django. It was
    introduced in d6c95e93 but not actually used nor documented, and it has
    just been carried around since then. Since it's an obscure private API,
    it's acceptable to stop supporting it without a deprecation path. This
    branch aims at providing first-class support for applications without a
    models module eventually.
    
    For backwards-compatibility, get_app() still raises ImproperlyConfigured
    when an app isn't found, even though LookupError is technically more
    correct. I haven't gone as far as to preserve the exact error messages.
    I've adjusted a few tests instead.
    a4cb1400
Adı
Son kayıt (commit)
Son güncelleme
..
app_with_import Loading commit data...
broken_app Loading commit data...
complex_app Loading commit data...
custom_templates Loading commit data...
management Loading commit data...
simple_app Loading commit data...
__init__.py Loading commit data...
models.py Loading commit data...
tests.py Loading commit data...
urls.py Loading commit data...