summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Graham <timograham@gmail.com>2010-12-29 15:47:46 +0000
committerTimo Graham <timograham@gmail.com>2010-12-29 15:47:46 +0000
commit12266059cd28db0fdc19cdd209dcf2a801817dd0 (patch)
tree2778801903d16d0a79500e6caef4151e9e666e0e
parentec38c88dfb7f737377297c56810cd44111270255 (diff)
Fixed #14712 - Add an example for the post_syncdb signal. Thanks Frank Wiles for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15104 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--docs/ref/signals.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/signals.txt b/docs/ref/signals.txt
index 8f295f1266..46e433a8b4 100644
--- a/docs/ref/signals.txt
+++ b/docs/ref/signals.txt
@@ -378,6 +378,17 @@ Arguments sent with this signal:
For example, the :mod:`django.contrib.auth` app only prompts to create a
superuser when ``interactive`` is ``True``.
+For example, yourapp/signals/__init__.py could be written like::
+
+ from django.db.models.signals import post_syncdb
+ import yourapp.models
+
+ def my_callback(sender, **kwargs):
+ # Your specific logic here
+ pass
+
+ post_syncdb.connect(my_callback, sender=yourapp.models)
+
Request/response signals
========================