X-Git-Url: https://scm.cri.mines-paristech.fr/git/Portfolio.git/blobdiff_plain/df7e1f0be93eec90ec3f6a998f45f5d83101bffe..b5ab6830421b7147eac005470f50d0cb44080daf:/skins/lrservice.py?ds=sidebyside diff --git a/skins/lrservice.py b/skins/lrservice.py index d41d355..8b56499 100644 --- a/skins/lrservice.py +++ b/skins/lrservice.py @@ -12,7 +12,7 @@ fg = context.REQUEST.form.get method = fg('method') if method == 'normaliseAndCreatePath' : - normalizedPath = [] + normalizedPath, uids = [], [] o = portal path = fg('path', '').split(' ') # séparateur : 0x09 (tabulation) for part in path : @@ -24,8 +24,10 @@ if method == 'normaliseAndCreatePath' : id = o.invokeFactory('Portfolio', validId, title=part) o = o[id] normalizedPath.append(id) + uid = uidtool.register(o) + uids.append(uid) - return '/'.join(normalizedPath) + return '%s\n%s' % ('/'.join(normalizedPath), ' '.join([str(uid) for uid in uids])) elif method == 'uploadPhoto' : path = fg('normalizedPath') @@ -44,8 +46,8 @@ elif method == 'uploadPhoto' : uid = uidtool.register(photo) return '%s %s' % (uid, photo.absolute_url()) -elif method == 'deletePhoto' : - photo = uidtool.queryObject(fg('uid')) - if photo : - parent = photo.getParentNode() - parent.manage_delObjects([photo.getId()]) +elif method in ('deletePhoto', 'deletePortfolio') : + o = uidtool.queryObject(fg('uid')) + if o : + parent = o.getParentNode() + parent.manage_delObjects([o.getId()])