1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Documented the Apps and AppConfig APIs.

This commit is contained in:
Aymeric Augustin
2013-12-24 15:40:12 +01:00
parent 9267fb88ef
commit f326720a73
4 changed files with 197 additions and 2 deletions

View File

@@ -278,7 +278,7 @@ class Apps(object):
app_name is the full name of the app eg. 'django.contrib.admin'.
It's safe to call this method at import time, even while the registry
is being populated. It returns None for apps that aren't loaded yet.
is being populated. It returns False for apps that aren't loaded yet.
"""
app_config = self.app_configs.get(app_name.rpartition(".")[2])
return app_config is not None and app_config.name == app_name
@@ -288,7 +288,7 @@ class Apps(object):
Returns the model class if one is registered and None otherwise.
It's safe to call this method at import time, even while the registry
is being populated. It returns None for models that aren't loaded yet.
is being populated. It returns False for models that aren't loaded yet.
"""
return self.all_models[app_label].get(model_name.lower())