Logo Search packages:      
Sourcecode: zope-coreblog version File versions

def zope-coreblog-1.0::Entry::Entry::editComment (   self,
  comment_id,
  title,
  author,
  body,
  email = "",
  url = "",
  REQUEST = None 
)

Edit a comment 

Definition at line 575 of file Entry.py.

00575                                                                                    :
        """ Edit a comment """
        if self.allow_comment != comment_open:
            #This entry does not allow adding trackback
            raise RuntimeError,"This entry is closed for editing comment."
        #COREBlog instanse
        cb = self.aq_parent

        int_comment_id = int(comment_id)
        obj = cb.getComment(int_comment_id)

        #Validaters
        v_h = cb.removeHTML
        v_c = cb.validateCommentBody
        obj.title = v_h(title)
        obj.author = v_h(author)
        obj.email = v_h(email)
        obj.url = v_h(url)
        obj.body = v_c(body)

        cb.setComment(int_comment_id,obj)

        if obj.moderated:
            #catalogging...
            self.index()

        #tell ZODB that object has added.
        self._p_changed = 1

        if REQUEST:
            return REQUEST.RESPONSE.redirect('./manage_comments')


    security.declareProtected(ManageCOREBlog, 'deleteAllComments')


Generated by  Doxygen 1.6.0   Back to index