However, with the introduction of the AppConfig, apps no longer required a
models.py and hence the documentation could benefit from an extra line of
explanation that ONLY the apps that have the models.py could register to
the database related signals.
On this page:
https://docs.djangoproject.com/en/dev/ref/applications/#django.apps.AppConfig.models_module
This:
"It may be None if the application doesn’t contain a models module."
Could be changed to:
"It may be None if the application doesn’t contain a models module. Please
note that only applications with a models module can register for the
database related signals such as '''pre_migrate''' / '''post_migrate'''
signals.
--
Ticket URL: <https://code.djangoproject.com/ticket/22028>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
'''Correction''':
This:
"It may be None if the application doesn’t contain a models module."
Could be changed to:
"It may be None if the application doesn’t contain a models module. Please
note that the database related signals such as pre_migrate / post_migrate
signals are only emitted for applications that have a models module.
--
Ticket URL: <https://code.djangoproject.com/ticket/22028#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22028#comment:2>
* status: new => assigned
* owner: nobody => donjpacheco
--
Ticket URL: <https://code.djangoproject.com/ticket/22028#comment:3>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/22028#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"55fb16258888443bc70398248b6e681f3bc032c8"]:
{{{
#!CommitTicketReference repository=""
revision="55fb16258888443bc70398248b6e681f3bc032c8"
Fixed #22028 -- Documented that database signals aren't emitted for apps
that laack a models module.
Thanks un33k for the suggestion and donjpacheco for the draft patch.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22028#comment:5>