otree_redwood.consumers module

class otree_redwood.consumers.EventConsumer(message, **kwargs)[source]

Bases: channels.generic.websockets.WebsocketConsumer

connect(message, **kwargs)[source]

Called when a WebSocket connection is opened.

connection_groups(**kwargs)[source]

Called to return the list of groups to automatically add/remove this connection to/from.

disconnect(message, **kwargs)[source]

Called when a WebSocket connection is closed.

raw_receive(message, **kwargs)[source]

Called when a WebSocket frame is received. Decodes it and passes it to receive().

send(content)[source]

Sends a reply back down the WebSocket

url_pattern = '^/redwood/app-name/(?P<app_name>[^/]+)/group/(?P<group>[0-9]+)/participant/(?P<participant_code>[a-zA-Z0-9_-]+)/$'
class otree_redwood.consumers.EventWatcher(message, **kwargs)[source]

Bases: channels.generic.websockets.WebsocketConsumer

connect(message, **kwargs)[source]

Called when a WebSocket connection is opened.

connection_groups(**kwargs)[source]

Called to return the list of groups to automatically add/remove this connection to/from.

url_pattern = '^/redwood/events/session/(?P<session_code>[a-zA-Z0-9_-]+)/$'
otree_redwood.consumers.get_group(app_name, group_pk)[source]
otree_redwood.consumers.on_event_save(sender, instance, **kwargs)[source]