Skip to content

Instantly share code, notes, and snippets.

@mitchellrj
Created March 16, 2012 18:25
Show Gist options
  • Save mitchellrj/2051657 to your computer and use it in GitHub Desktop.
Save mitchellrj/2051657 to your computer and use it in GitHub Desktop.
Clear all plone.app.discussion comments
catalog_interfaces = ('plone.app.discussion.interfaces.IComment',)
pc = context.portal_catalog
comment_brains = pc(object_provides=tuple(catalog_interfaces))
for b in comment_brains:
comment = b.getObject()
comment_id = comment.comment_id
conversation = comment.aq_parent
del conversation[comment_id]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment