[Django] #22028: documentation: apps without models.py can register for db related signals

4 views
Skip to first unread message

Django

unread,
Feb 12, 2014, 11:10:55 AM2/12/14
to django-...@googlegroups.com
#22028: documentation: apps without models.py can register for db related signals
-------------------------------------+-------------------------------------
Reporter: un33k | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Documentation | Keywords: apps without models
Severity: Normal | database signals
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/22028>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 12, 2014, 11:14:21 AM2/12/14
to django-...@googlegroups.com
#22028: documentation: apps without models.py can register for db related signals
-------------------------------------+-------------------------------------
Reporter: un33k | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Documentation | Resolution:
Severity: Normal | Triage Stage:
Keywords: apps without models | Unreviewed
database signals | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by un33k):

* 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>

Django

unread,
Feb 18, 2014, 9:45:12 AM2/18/14
to django-...@googlegroups.com
#22028: documentation: apps without models.py can register for db related signals
-------------------------------------+-------------------------------------
Reporter: un33k | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: apps without models | Needs documentation: 0
database signals | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/22028#comment:2>

Django

unread,
Feb 23, 2014, 1:57:28 AM2/23/14
to django-...@googlegroups.com
#22028: documentation: apps without models.py can register for db related signals
-------------------------------------+-------------------------------------
Reporter: un33k | Owner:
Type: | donjpacheco
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: apps without models | Triage Stage: Accepted

database signals | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by donjpacheco):

* status: new => assigned
* owner: nobody => donjpacheco


--
Ticket URL: <https://code.djangoproject.com/ticket/22028#comment:3>

Django

unread,
Feb 23, 2014, 2:29:46 AM2/23/14
to django-...@googlegroups.com
#22028: documentation: apps without models.py can register for db related signals
-------------------------------------+-------------------------------------
Reporter: un33k | Owner:
Type: | donjpacheco
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: apps without models | Triage Stage: Accepted
database signals | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0

Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by donjpacheco):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/22028#comment:4>

Django

unread,
Feb 28, 2014, 9:26:50 AM2/28/14
to django-...@googlegroups.com
#22028: documentation: apps without models.py can register for db related signals
-------------------------------------+-------------------------------------
Reporter: un33k | Owner:
Type: | donjpacheco
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: apps without models | Triage Stage: Accepted
database signals | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* 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>

Reply all
Reply to author
Forward
0 new messages