From 174430c8174e80a80ff353dc131020db29cab523 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 22 Jul 2016 21:36:28 -0400 Subject: [PATCH] fields update for binding --- docs/binding.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/binding.rst b/docs/binding.rst index 2e1213a..26ee3bb 100644 --- a/docs/binding.rst +++ b/docs/binding.rst @@ -65,6 +65,7 @@ get started and likely close to what you want. Start off like this:: model = IntegerValue stream = "intval" + fields = ["name", "value"] def group_names(self, instance, action): return ["intval-updates"] @@ -73,9 +74,13 @@ get started and likely close to what you want. Start off like this:: return True This defines a WebSocket binding - so it knows to send outgoing messages -formatted as JSON WebSocket frames - and provides the two methods you must +formatted as JSON WebSocket frames - and provides the three things you must always provide: +* ``fields`` is a whitelist of fields to return in the serialized request. + Channels does not default to all fields for security concerns; if you want + this, set it to the value ``["__all__"]``. + * ``group_names`` returns a list of groups to send outbound updates to based on the model and action. For example, you could dispatch posts on different liveblogs to groups that included the parent blog ID in the name; here, we