Ticket #14712: post_syncdb_example.diff

File post_syncdb_example.diff, 708 bytes (added by frankwiles, 5 years ago)

docs patch

  • docs/ref/signals.txt

    diff --git a/docs/ref/signals.txt b/docs/ref/signals.txt
    index 4c1db33..35e9588 100644
    a b Arguments sent with this signal: 
    375375        For example, the :mod:`django.contrib.auth` app only prompts to create a
    376376        superuser when ``interactive`` is ``True``.
    377377
     378Example, in yourapp/management/__init__.py would written like:
     379
     380.. code-block:: python
     381
     382    from django.db.models.signals import post_syncdb
     383    import yourapp.models
     384
     385    def my_callback(sender, **kwargs):
     386        # Your specific logic here
     387
     388    post_syncdb.connect(my_callback, sender=yourapp.models)
     389
    378390Request/response signals
    379391========================
    380392
Back to Top