Commit 69a1fb1f authored by Hanno Schlichting's avatar Hanno Schlichting

Retain support for marhalling DateTime objects via xmlrpc

parent 44b00e1a
...@@ -31,7 +31,7 @@ from ZODB.POSException import ConflictError ...@@ -31,7 +31,7 @@ from ZODB.POSException import ConflictError
# Make DateTime.DateTime marshallable via XML-RPC # Make DateTime.DateTime marshallable via XML-RPC
# http://www.zope.org/Collectors/Zope/2109 # http://www.zope.org/Collectors/Zope/2109
from DateTime.DateTime import DateTime from DateTime.DateTime import DateTime
WRAPPERS = xmlrpclib.WRAPPERS + (DateTime,) WRAPPERS = xmlrpclib.WRAPPERS + (DateTime, )
def dump_instance(self, value, write): def dump_instance(self, value, write):
# Check for special wrappers # Check for special wrappers
...@@ -49,6 +49,8 @@ def dump_instance(self, value, write): ...@@ -49,6 +49,8 @@ def dump_instance(self, value, write):
self.dump_struct(value, write) self.dump_struct(value, write)
xmlrpclib.Marshaller.dispatch[types.InstanceType] = dump_instance xmlrpclib.Marshaller.dispatch[types.InstanceType] = dump_instance
xmlrpclib.Marshaller.dispatch[DateTime] = dump_instance
def parse_input(data): def parse_input(data):
"""Parse input data and return a method path and argument tuple """Parse input data and return a method path and argument tuple
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment