Tim Nyborg and GitHub
77a5c01ac9
Allow custom json encoder
...
This lets an application use a custom JSONEncoder when making jsonrpc calls (to automatically handle, say, serialization of datetime, or Decimal, or custom classes).
e.g.:
import json, datetime, decimal
class ExtendedEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.isoformat()
if isinstance(obj, decimal.Decimal):
return str(obj)
return super(ExtendedEncoder, self).default(obj)
api = ServerProxy(address, version='2.0', encoder=ExtendedEncoder)
2018-10-29 15:16:28 +00:00
..
2016-06-04 09:23:31 +02:00
2018-05-03 17:15:53 +01:00
2018-06-08 10:41:13 +01:00
2018-06-19 21:18:33 -03:00
2018-08-02 11:04:14 +02:00
2017-04-13 06:31:40 +07:00
2017-06-20 22:12:43 +02:00
2016-05-12 16:14:01 +02:00
2016-10-04 00:11:54 +02:00
2016-10-01 00:15:47 +02:00
2016-05-30 21:23:40 +02:00
2018-04-19 08:57:25 +02:00
2012-09-30 13:40:41 -05:00
2014-12-27 12:16:52 +01:00
2016-08-13 15:38:55 +02:00
2018-06-08 10:45:36 +01:00
2016-08-13 15:38:55 +02:00
2016-10-08 12:26:04 +02:00
2018-06-08 10:54:57 +01:00
2016-03-18 12:04:27 -04:00
2014-05-26 23:49:11 -05:00
2016-05-29 08:31:19 +02:00
2018-08-02 11:04:14 +02:00
2018-06-07 23:17:07 +01:00
2017-07-10 00:17:15 +01:00
2016-07-05 08:35:42 -05:00
2017-07-14 20:17:30 +01:00
2016-12-03 08:42:35 +01:00
2015-01-17 00:07:10 -06:00
2016-05-11 01:03:04 +01:00
2016-05-30 21:23:40 +02:00
2012-12-20 09:22:24 -06:00
2016-10-04 00:11:54 +02:00
2016-10-04 00:11:54 +02:00
2016-05-30 21:23:40 +02:00
2017-11-08 00:40:47 -06:00
2016-06-04 09:23:31 +02:00
2015-04-13 18:43:48 -04:00
2018-08-17 16:35:54 +02:00
2016-07-18 21:36:56 +02:00
2018-04-14 14:58:53 +03:00
2018-04-14 14:33:37 +03:00
2012-11-04 19:55:15 -06:00
2016-08-13 15:38:55 +02:00
2016-05-11 00:47:23 +01:00
2018-10-29 15:16:28 +00:00
2012-10-19 12:33:53 -05:00
2016-05-30 21:23:40 +02:00
2016-05-30 21:23:40 +02:00
2016-05-30 21:23:40 +02:00
2016-05-30 21:23:40 +02:00
2017-08-08 00:50:55 +01:00
2017-04-03 19:54:06 +01:00
2017-08-07 07:27:28 -05:00