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.
* 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>
* owner: nobody => Caio Ariede
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:2>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/13201 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:3>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:4>
* needs_better_patch: 1 => 0
Comment:
Author appears ready for another review.
--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:5>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:6>
* owner: Caio Ariede => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:7>
* 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>
* owner: Sarah Abderemane => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:9>
* owner: (none) => Joseph V Zammit
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:10>
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>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/30801#comment:12>
* 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>
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>