diff options
| author | Timo Graham <timograham@gmail.com> | 2010-12-29 15:48:50 +0000 |
|---|---|---|
| committer | Timo Graham <timograham@gmail.com> | 2010-12-29 15:48:50 +0000 |
| commit | 863240e336949f93fabfc11166a1386328a30af9 (patch) | |
| tree | 9289649ab6035674bc0a9d9ab71ef29f000ad5bb | |
| parent | b5a7ac4fff1d3830a57012da42b0ba5d92fc9d48 (diff) | |
[1.2.X] Fixed #14712 - Add an example for the post_syncdb signal. Thanks Frank Wiles for the patch.
Backport of r15104 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15105 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | docs/ref/signals.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/signals.txt b/docs/ref/signals.txt index 0108819b77..bb009f9744 100644 --- a/docs/ref/signals.txt +++ b/docs/ref/signals.txt @@ -356,6 +356,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 ======================== |
