Improve guidance for making good use of signals.
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.
- 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.
- 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.
Change History
(14)
Easy pickings: |
unset
|
Summary: |
Improve guidance for making good use of signals → Improve guidance for making good use of signals.
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to Caio Ariede
|
Status: |
new → assigned
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Patch needs improvement: |
set
|
Owner: |
Caio Ariede removed
|
Status: |
assigned → new
|
Owner: |
set to Sarah Abderemane
|
Status: |
new → assigned
|
Owner: |
Sarah Abderemane removed
|
Status: |
assigned → new
|
Owner: |
set to Joseph V Zammit
|
Status: |
new → assigned
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Thanks. I wouldn't say that providing good examples and alternatives is "Easy picking" that's why I unchecked this flag.