Back to index

plone3  3.1.7
discussion_reply.py
Go to the documentation of this file.
00001 ##parameters=title, text, **kw
00002 ##title=Reply to content
00003 ##
00004 from Products.CMFCore.utils import getUtilityByInterfaceName
00005 from Products.CMFDefault.utils import Message as _
00006 
00007 dtool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IDiscussionTool')
00008 
00009 talkback = dtool.getDiscussionFor(context)
00010 replyID = talkback.createReply(title=title, text=text)
00011 reply = talkback.getReply(replyID)
00012 
00013 context.setStatus(True, _(u'Reply added.'))
00014 context.setRedirect(reply, 'object/view')