kopia lustrzana https://github.com/wagtail/wagtail
Minor documentation fixes for signal handlers
rodzic
de93b14a08
commit
b0f4d50aac
|
@ -29,13 +29,13 @@ example showing how you might notify your team when something is published:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtailcore.signals import page_published
|
||||
from wagtail.wagtailcore.signals import page_published
|
||||
import urllib
|
||||
import urllib2
|
||||
|
||||
|
||||
# Let everyone know when a new page is published
|
||||
def send_to_slack(sender, **kwargs)
|
||||
def send_to_slack(sender, **kwargs):
|
||||
instance = kwargs['instance']
|
||||
url = 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
|
||||
values = {
|
||||
|
@ -62,7 +62,7 @@ wish to do something when a new blog post is published:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtailcore.signals import page_published
|
||||
from wagtail.wagtailcore.signals import page_published
|
||||
from mysite.models import BlogPostPage
|
||||
|
||||
# Do something clever for each model type
|
||||
|
@ -85,4 +85,4 @@ This signal is emitted from a ``Page`` when the page is unpublished.
|
|||
|
||||
:sender: The page ``class``
|
||||
:instance: The specific ``Page`` instance.
|
||||
:kwargs: Any other arguments passed to ``page_unpublished.send()``
|
||||
:kwargs: Any other arguments passed to ``page_unpublished.send()``
|
||||
|
|
Ładowanie…
Reference in New Issue