Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14712 - Add an example for the post_syncdb signal. Thanks Fran…

…k Wiles for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15104 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 12266059cd28db0fdc19cdd209dcf2a801817dd0 1 parent ec38c88
Tim Graham authored December 29, 2010

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  docs/ref/signals.txt
11  docs/ref/signals.txt
@@ -378,6 +378,17 @@ Arguments sent with this signal:
378 378
         For example, the :mod:`django.contrib.auth` app only prompts to create a
379 379
         superuser when ``interactive`` is ``True``.
380 380
 
  381
+For example, yourapp/signals/__init__.py could be written like::
  382
+
  383
+    from django.db.models.signals import post_syncdb
  384
+    import yourapp.models
  385
+
  386
+    def my_callback(sender, **kwargs):
  387
+        # Your specific logic here
  388
+        pass
  389
+
  390
+    post_syncdb.connect(my_callback, sender=yourapp.models)
  391
+
381 392
 Request/response signals
382 393
 ========================
383 394
 

0 notes on commit 1226605

Please sign in to comment.
Something went wrong with that request. Please try again.