Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Przenieść sygnały do signals.py i zarejestrować w aplikacji #445

Open
ad-m opened this issue Sep 21, 2017 · 4 comments
Open

Przenieść sygnały do signals.py i zarejestrować w aplikacji #445

ad-m opened this issue Sep 21, 2017 · 4 comments
Assignees

Comments

@ad-m
Copy link
Member

ad-m commented Sep 21, 2017

Podczas rozwoju aplikacji Django odstąpiono od zalecenia, aby sygnały były rejestrowane w models.py. Teraz należy to robić w app config.

Zobacz na https://docs.djangoproject.com/en/1.11/topics/signals/ :

Where should this code live?
Strictly speaking, signal handling and registration code can live anywhere you like, although it’s recommended to avoid the application’s root module and its models module to minimize side-effects of importing code.
In practice, signal handlers are usually defined in a signals submodule of the application they relate to. Signal receivers are connected in the ready() method of your application configuration class. If you’re using the receiver() decorator, simply import the signals submodule inside ready().

@ad-m
Copy link
Member Author

ad-m commented Jul 8, 2019

@AgnieszkaZdanowicz
Copy link

@ad-m czy to aktualne?

@ad-m
Copy link
Member Author

ad-m commented Jul 16, 2020

Tak.

@AgnieszkaZdanowicz
Copy link

nie wiem, o co tu chodzi, nie potrafię ocenić, czy nad tym pracować

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants