Commit Graph

17 Commits

Author SHA1 Message Date
AlexejStukov
0f1ac3d08b Fix member serialization in WebsocketBindingWithMembers (#292)
* Fix member serialization in WebsocketBindingWithMembers

* pep fixes

* allow usage of 'dot'-notation in send_members

* replace dots for dictionary

* single quotes
2016-08-10 21:55:51 -07:00
AlexejStukov
0bc1cee103 Easy application of decorators to Bindings (#281)
* Added get_handler

Added a get_handler method that applies decorators to the consumer-classmethod

* added imports for decorators

* Added get_handler to WebsocketBinding

* Fixed missing import

* channel_session_user defaults to True

* removed user-transfer from http

would only work in a connect-method

* removed unused import
2016-08-05 00:12:59 -07:00
Andrew Godwin
4724ee4529 Mark WebsocketBindingWithMembers as abstract 2016-07-28 11:12:51 +01:00
AlexejStukov
77f41ce1a9 Added WebsocketBindingWithMembers (#262)
* Added WebsocketBindingWithMembers

WebsocketBindingWithMembers inherits WebsocketBinding and additionally enables sending of member variables, properties and methods.

* pep fixes

* pep fixes

* Changed to Mixin

More flexible this way; also checking if members are callable now, not just a try-except.

* moved BindingWithMembersMixin to base.py

* moved BindingWithMembersMixin to base.py

* undo moving to base.py

* undo moving to base.py; undo Mixin

* use DjangoJSONEncoder to serialize members

* missing self

* removed nasty whitespace
2016-07-28 10:55:28 +01:00
Andrew Godwin
a4c8602ea1 Move fields check to register so it happens on server start 2016-07-22 21:40:51 -04:00
AlexejStukov
4625266db6 raise error if self.fields is empty 2016-07-22 08:17:49 +02:00
AlexejStukov
6eda634746 whitespace 2016-07-21 21:08:47 +02:00
AlexejStukov
d07600f04b Security fix - every field of a model is send - even password
Atm WebsocketBinding sends every field of a model, even the password of a user. Users of the class should have to think about which fields they want to send to the user. Also added a more intuitive option for sending all fields.
2016-07-21 21:06:25 +02:00
AlexejStukov
16c80c3900 fixed whitespace 2016-07-21 09:52:43 +02:00
AlexejStukov
38430b41d1 add encode to WbesocketBinding 2016-07-21 09:33:28 +02:00
AlexejStukov
1cca353e51 removed encoding from serialize 2016-07-21 08:46:29 +02:00
AlexejStukov
bb74c80b71 add a modelname to the payload dict
see #256
2016-07-20 18:21:23 +02:00
Andrew Godwin
f1e8eb66e6 Remove unused import 2016-07-19 07:29:36 -04:00
Andrew Godwin
4370f043f7 Make group_send/demultiplex encode classmethods 2016-07-18 23:24:28 -04:00
Andrew Godwin
cbe6afff85 Why not rewrite binding into multiplexers on a Monday night? 2016-07-18 23:12:44 -04:00
Andrew Godwin
5d2354c71b Provide default serializers for the JSON one 2016-07-18 14:57:19 -04:00
Andrew Godwin
62d4782dbd First version of binding code 2016-07-14 23:15:57 -07:00