Fix send call in concepts doc

This commit is contained in:
Andrew Godwin 2016-05-31 18:34:06 +00:00
parent 80a9019cb2
commit df0ae80bfb

View File

@ -184,10 +184,10 @@ set of channels (here, using Redis) to send updates to::
def send_update(sender, instance, **kwargs): def send_update(sender, instance, **kwargs):
# Loop through all response channels and send the update # Loop through all response channels and send the update
for reply_channel in redis_conn.smembers("readers"): for reply_channel in redis_conn.smembers("readers"):
Channel(reply_channel).send( Channel(reply_channel).send({
id=instance.id, "id": instance.id,
content=instance.content, "content": instance.content,
) })
# Connected to websocket.connect # Connected to websocket.connect
def ws_connect(message): def ws_connect(message):
@ -222,10 +222,10 @@ abstraction as a core concept called Groups::
@receiver(post_save, sender=BlogUpdate) @receiver(post_save, sender=BlogUpdate)
def send_update(sender, instance, **kwargs): def send_update(sender, instance, **kwargs):
Group("liveblog").send( Group("liveblog").send({
id=instance.id, "id": instance.id,
content=instance.content, "content": instance.content,
) })
# Connected to websocket.connect # Connected to websocket.connect
def ws_connect(message): def ws_connect(message):