[Django] #30801: Improve guidance for making good use of signals

16 views
Skip to first unread message

Django

unread,
Sep 25, 2019, 10:35:03 AM9/25/19
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals
------------------------------------------------+------------------------
Reporter: Aymeric Augustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
This is a follow-up to https://github.com/django/django/pull/11814 and
https://groups.google.com/d/msg/django-
developers/c5sFZ5BEujI/jVLsfSYBAwAJ.

I have two suggestions to improve the documentation of signals.

1. In ref/signals.txt, for each signal, document the alternatives, which
will usually be more robust and maintainable:

- Instead of a model signals, you can override the corresponding
method in the model class — unless that model is provided by a library and
cannot be swapped
- Instead of request/response signals, you can provide a middleware.
- As far as I can tell, other signals don't have a great alternative.
You could replace `connection_created` by a custom database backend but
that's a lot more work.

2. In the introduction of topics/signals.txt, replace the list of signals
with a good example. In my opinion, `setting_changed` is likely the best
example: many pluggable apps need it in their test suite.

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

Django

unread,
Sep 25, 2019, 2:02:16 PM9/25/19
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
--------------------------------------+------------------------------------

Reporter: Aymeric Augustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

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

* stage: Unreviewed => Accepted
* easy: 1 => 0


Comment:

Thanks. I wouldn't say that providing good examples and alternatives is
"Easy picking" that's why I unchecked this flag.

--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:1>

Django

unread,
Jul 14, 2020, 8:34:01 AM7/14/20
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Caio
Type: | Ariede
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Caio Ariede):

* owner: nobody => Caio Ariede
* status: new => assigned


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

Django

unread,
Jul 16, 2020, 9:15:22 AM7/16/20
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Caio
Type: | Ariede
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Caio Ariede):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/13201 PR]

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

Django

unread,
Jul 17, 2020, 2:42:49 AM7/17/20
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Caio
Type: | Ariede
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


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

Django

unread,
Oct 29, 2020, 7:50:01 AM10/29/20
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Caio
Type: | Ariede
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0


Comment:

Author appears ready for another review.

--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:5>

Django

unread,
Nov 4, 2020, 6:26:40 AM11/4/20
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Caio
Type: | Ariede
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:6>

Django

unread,
Dec 31, 2021, 1:31:12 AM12/31/21
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
--------------------------------------+------------------------------------
Reporter: Aymeric Augustin | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: Caio Ariede => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:7>

Django

unread,
Mar 9, 2022, 11:08:17 AM3/9/22
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Sarah
Type: | Abderemane
Cleanup/optimization | Status: assigned

Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Abderemane):

* owner: (none) => Sarah Abderemane


* status: new => assigned


Comment:

Hi there, I would like to give a try on this ticket, but I'm not sure to
understand what I should do with this part :

> As far as I can tell, other signals don't have a great alternative. You
could replace connection_created by a custom database backend but that's a
lot more work.

It's to redirect to the part of the documentation where we define custom
database or something else?

--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:8>

Django

unread,
Oct 13, 2022, 3:19:08 AM10/13/22
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
--------------------------------------+------------------------------------
Reporter: Aymeric Augustin | Owner: (none)
Type: Cleanup/optimization | Status: new

Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Sarah Abderemane):

* owner: Sarah Abderemane => (none)


* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:9>

Django

unread,
Oct 20, 2022, 4:29:54 AM10/20/22
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Joseph V
Type: | Zammit
Cleanup/optimization | Status: assigned

Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Joseph V Zammit):

* owner: (none) => Joseph V Zammit


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:10>

Django

unread,
Oct 23, 2022, 4:49:14 AM10/23/22
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Joseph V
Type: | Zammit
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Joseph V Zammit):

Tentative PR is open here: ​https://github.com/django/django/pull/16221

--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:11>

Django

unread,
Nov 2, 2022, 11:11:09 AM11/2/22
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Joseph V
Type: | Zammit
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 1 => 0

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:12>

Django

unread,
Nov 2, 2022, 12:50:35 PM11/2/22
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Joseph V
Type: | Zammit
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson <carlton.gibson@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"71e9694856627d4027c9df066045f0e1c2b5cf27" 71e9694]:
{{{
#!CommitTicketReference repository=""
revision="71e9694856627d4027c9df066045f0e1c2b5cf27"
Fixed #30801 -- Improved guidance for making good use of signals.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:13>

Django

unread,
Nov 2, 2022, 12:50:59 PM11/2/22
to django-...@googlegroups.com
#30801: Improve guidance for making good use of signals.
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Joseph V
Type: | Zammit
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton.gibson@…>):

In [changeset:"018311d481d4ad949633cab1adb7677b927c8b1e" 018311d]:
{{{
#!CommitTicketReference repository=""
revision="018311d481d4ad949633cab1adb7677b927c8b1e"
[4.1.x] Fixed #30801 -- Improved guidance for making good use of signals.

Backport of 71e9694856627d4027c9df066045f0e1c2b5cf27 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:14>

Reply all
Reply to author
Forward
0 new messages