Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
d66bda60
Kaydet (Commit)
d66bda60
authored
Kas 27, 2014
tarafından
wrwrwr
Kaydeden (comit)
Tim Graham
Kas 27, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added notes on registering signals in ready() and using dispatch_uid.
Refs #23641.
üst
a15aba66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
signals.txt
docs/ref/signals.txt
+9
-0
signals.txt
docs/topics/signals.txt
+7
-0
No files found.
docs/ref/signals.txt
Dosyayı görüntüle @
d66bda60
...
@@ -509,6 +509,15 @@ For example, you could register a callback in an
...
@@ -509,6 +509,15 @@ For example, you could register a callback in an
def ready(self):
def ready(self):
post_migrate.connect(my_callback, sender=self)
post_migrate.connect(my_callback, sender=self)
.. note::
If you provide an :class:`~django.apps.AppConfig` instance as the sender
argument, please ensure that the signal is registered in
:meth:`~django.apps.AppConfig.ready`. ``AppConfig``\s are recreated for
tests that run with a modified set of :setting:`INSTALLED_APPS` (such as
when settings are overridden) and such signals should be connected for each
new ``AppConfig`` instance.
post_syncdb
post_syncdb
-----------
-----------
...
...
docs/topics/signals.txt
Dosyayı görüntüle @
d66bda60
...
@@ -146,6 +146,13 @@ Now, our ``my_callback`` function will be called each time a request finishes.
...
@@ -146,6 +146,13 @@ Now, our ``my_callback`` function will be called each time a request finishes.
versions of Django, signal registration usually happened in the
versions of Django, signal registration usually happened in the
``models`` module.
``models`` module.
.. note::
The :meth:`~django.apps.AppConfig.ready` method may be executed more than
once during testing, so you may want to :ref:`guard your signals from
duplication <preventing-duplicate-signals>`, especially if you're planning
to send them within tests.
.. _connecting-to-specific-signals:
.. _connecting-to-specific-signals:
Connecting to signals sent by specific senders
Connecting to signals sent by specific senders
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment