1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

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.
This commit is contained in:
Aymeric Augustin
2016-09-30 21:35:04 +02:00
committed by Tim Graham
parent efcb7e1ebf
commit fd748c42a9
3 changed files with 8 additions and 10 deletions

View File

@@ -214,8 +214,8 @@ class AppConfigStub(AppConfig):
# the app name, but we need something unique, and the label works fine.
super(AppConfigStub, self).__init__(label, None)
def import_models(self, all_models):
self.models = all_models
def import_models(self):
self.models = self.apps.all_models[self.label]
class StateApps(Apps):