Loading django/apps/base.py +2 −2 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ class AppConfig(object): models_module_name = '%s.%s' % (self.name, MODELS_MODULE_NAME) self.models_module = import_module(models_module_name) def setup(self): def ready(self): """ Override this method in subclasses to run setup code. Override this method in subclasses to run code when Django starts. """ django/apps/registry.py +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ class Apps(object): self.ready = True for app_config in self.get_app_configs(): app_config.setup() app_config.ready() def check_ready(self): """ Loading docs/ref/applications.txt +3 −3 Original line number Diff line number Diff line Loading @@ -175,10 +175,10 @@ Methods ``model_name``. Raises :exc:`~exceptions.LookupError` if no such model exists. ``model_name`` is case-insensitive. .. method:: AppConfig.setup() .. method:: AppConfig.ready() Subclasses can override this method to perform setup tasks such as registering signals. It is called as soon as the registry is fully Subclasses can override this method to perform initialization tasks such as registering signals. It is called as soon as the registry is fully populated. Application registry Loading docs/ref/signals.txt +1 −1 Original line number Diff line number Diff line Loading @@ -355,7 +355,7 @@ been defined and registered with Django's model system. Django uses this signal internally; it's not generally used in third-party applications. Since this signal is sent during the app registry population process, and :meth:`AppConfig.setup() <django.apps.AppConfig.setup>` runs after the app :meth:`AppConfig.ready() <django.apps.AppConfig.ready>` runs after the app registry is fully populated, receivers cannot be connected in that method. One possibility is to connect them ``AppConfig.__init__()`` instead, taking care not to import models or trigger calls to the app registry. Loading docs/releases/1.7.txt +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ attach configuration data to applications. Improvements thus far include: * Applications can run code at startup, before Django does anything else, with the :meth:`~django.apps.AppConfig.setup` method of their configuration. the :meth:`~django.apps.AppConfig.ready` method of their configuration. * It is possible to omit ``models.py`` entirely if an application doesn't have any models. Loading Loading
django/apps/base.py +2 −2 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ class AppConfig(object): models_module_name = '%s.%s' % (self.name, MODELS_MODULE_NAME) self.models_module = import_module(models_module_name) def setup(self): def ready(self): """ Override this method in subclasses to run setup code. Override this method in subclasses to run code when Django starts. """
django/apps/registry.py +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ class Apps(object): self.ready = True for app_config in self.get_app_configs(): app_config.setup() app_config.ready() def check_ready(self): """ Loading
docs/ref/applications.txt +3 −3 Original line number Diff line number Diff line Loading @@ -175,10 +175,10 @@ Methods ``model_name``. Raises :exc:`~exceptions.LookupError` if no such model exists. ``model_name`` is case-insensitive. .. method:: AppConfig.setup() .. method:: AppConfig.ready() Subclasses can override this method to perform setup tasks such as registering signals. It is called as soon as the registry is fully Subclasses can override this method to perform initialization tasks such as registering signals. It is called as soon as the registry is fully populated. Application registry Loading
docs/ref/signals.txt +1 −1 Original line number Diff line number Diff line Loading @@ -355,7 +355,7 @@ been defined and registered with Django's model system. Django uses this signal internally; it's not generally used in third-party applications. Since this signal is sent during the app registry population process, and :meth:`AppConfig.setup() <django.apps.AppConfig.setup>` runs after the app :meth:`AppConfig.ready() <django.apps.AppConfig.ready>` runs after the app registry is fully populated, receivers cannot be connected in that method. One possibility is to connect them ``AppConfig.__init__()`` instead, taking care not to import models or trigger calls to the app registry. Loading
docs/releases/1.7.txt +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ attach configuration data to applications. Improvements thus far include: * Applications can run code at startup, before Django does anything else, with the :meth:`~django.apps.AppConfig.setup` method of their configuration. the :meth:`~django.apps.AppConfig.ready` method of their configuration. * It is possible to omit ``models.py`` entirely if an application doesn't have any models. Loading