diff --git a/roundup/xmlrpc.py b/roundup/xmlrpc.py
index 0014df36428156f831878d80478d60144a3ab3a1..86c8f992b207e443bacbd101311b16c3b209bae2 100644 (file)
--- a/roundup/xmlrpc.py
+++ b/roundup/xmlrpc.py
self.actions = actions
self.translator = translator
+ def schema(self):
+ s = {}
+ for c in self.db.classes:
+ cls = self.db.classes[c]
+ props = [(n,repr(v)) for n,v in cls.properties.items()]
+ s[c] = props
+ return s
+
def list(self, classname, propname=None):
cl = self.db.getclass(classname)
if not propname:
for key in props:
if not self.db.security.hasPermission('Edit', self.db.getuid(), classname,
property=key):
- raise Unauthorised('Permission to create %s denied'%classname)
+ raise Unauthorised('Permission to set %s.%s denied'%(classname, key))
# do the actual create
try:
result = cl.create(**props)
+ self.db.commit()
except (TypeError, IndexError, ValueError), message:
raise UsageError, message
return result
raise Unauthorised('Permission to edit %s of %s denied'%
(p, designator))
try:
- return cl.set(itemid, **props)
+ result = cl.set(itemid, **props)
+ self.db.commit()
except (TypeError, IndexError, ValueError), message:
raise UsageError, message
+ return result
builtin_actions = {'retire': actions.Retire}
def __init__(self, db, actions, translator,
allow_none=False, encoding=None):
- SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
+ try:
+ # python2.5 and beyond
+ SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
+ except TypeError:
+ # python2.4
+ SimpleXMLRPCDispatcher.__init__(self)
self.register_instance(RoundupInstance(db, actions, translator))