summaryrefslogtreecommitdiff
path: root/django/apps/config.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2016-09-30 21:35:04 +0200
committerTim Graham <timograham@gmail.com>2016-10-28 18:43:45 -0400
commitfd748c42a96213ebc0a18cc661ecb1abaadabcca (patch)
tree328af4da7514338c52b78a78b6c398b1758e861d /django/apps/config.py
parentefcb7e1ebf2b852a442d00a31634438359eb4039 (diff)
Simplified AppConfig.import_models().
Since AppConfig now has a reference to its parent Apps registry, it can look up the models there instead of receiving them in argument.
Diffstat (limited to 'django/apps/config.py')
-rw-r--r--django/apps/config.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/django/apps/config.py b/django/apps/config.py
index 178fe97130..72c5121411 100644
--- a/django/apps/config.py
+++ b/django/apps/config.py
@@ -190,12 +190,10 @@ class AppConfig(object):
continue
yield model
- def import_models(self, all_models):
+ def import_models(self):
# Dictionary of models for this app, primarily maintained in the
# 'all_models' attribute of the Apps this AppConfig is attached to.
- # Injected as a parameter because it gets populated when models are
- # imported, which might happen before populate() imports models.
- self.models = all_models
+ self.models = self.apps.all_models[self.label]
if module_has_submodule(self.module, MODELS_MODULE_NAME):
models_module_name = '%s.%s' % (self.name, MODELS_MODULE_NAME)