Opened 11 years ago
Closed 11 years ago
#22028 closed Cleanup/optimization (fixed)
documentation: apps without models.py can register for db related signals
Reported by: | Val Neekman | Owned by: | donjpacheco |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | apps without models database signals |
Cc: | vneekman@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Before Django 1.7, all apps in the INSTALLED_APPS required to have a models.py, and they could latch onto the database related signals such as the pre_syncdb and the post_syncdb. So the documentations didn't need to be specific.
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.
Attachments (1)
Change History (6)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 11 years ago
Attachment: | django-applications.diff added |
---|
added line to django ref applications documentation
comment:4 by , 11 years ago
Has patch: | set |
---|
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.