On 16 January 2017 at 15:36, Adam Johnson <[email protected]> wrote:

> The signals as proposed can't really be used for the staticfiles override,
> since that requires subclassing and wrapping a function to change the
> handler ( source
> <https://github.com/django/django/blob/master/django/contrib/staticfiles/management/commands/runserver.py>
> ). If there are other use cases I think they'd also normally be better
> handled by more specific signals, e.g. post_migrate
> <https://github.com/django/django/blob/3c447b108ac70757001171f7a4791f493880bf5b/django/db/models/signals.py#L59>,
> rather than a generic all-commands signal.
>

I agree that staticfiles override is a bad example as signals should not be
used to alter it's sender's behavior, however generalizing
pre_migrate/post_migrate into command signals doesn't seem like a bad idea
to me. Anyway, I created a PR with PoC implementation of command signals
with slightly different usage that my previous example code:
https://github.com/django/django/pull/7857

--
Best wishes,
Dmitry Gladkov

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CA%2BkbqrXdQgeedhNAW_1CnM0dKuw-RHcrCP2JAB_%2B-cGaxuLeVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to