[Zope-CMF] Discussion Management, delete replies?

Chris Hinds chris@palefish.co.uk
Sat, 27 Oct 2001 12:50:32 +0100


Hi,

I know this topic has been round the list a couple of times, but I've not=
=20
managed to apply any of it successfully! If anyone could point me in the=20
right direction I would be most most grateful.

Let me outline what I've tried:

1) Tres suggested an external method -=20

=A0 =A0def deleteReply( self, reply_path ):
=A0 =A0 =A0 =A0"""
=A0 =A0 =A0 =A0 =A0 =A0Delete the reply pointed to by 'reply_path' from o=
ur talkback.
=A0 =A0 =A0 =A0"""
=A0 =A0 =A0 =A0if type( reply_path ) =3D=3D type( '' ):
=A0 =A0 =A0 =A0 =A0 =A0reply_path =3D string.split( reply_path, '/' )
=A0 =A0 =A0 =A0reply_id =3D reply_path[ -1 ]
=A0 =A0 =A0 =A0del self.talkback._container[ reply_id ]

I know this is me being dim but, where do I put it? how do i cause it to =
be=20
executed? Too much magic!! My attempts have been unsuccessful.


2) Erik Enge's howto http://www.zope.org/Members/eenge/cmf-discussions
This looked oh so promising, following the advice I managed to obtain a Z=
MI=20
folder list on=20
http://server:8080/portal/newsitem/talkback/manage
containing all of the replies. However, trying to delete one produces=20

Error Type: BadRequest
Error Value: 1004135779 does not exist
...
File /usr/zope/Zope-2.3.2-src/lib/python/OFS/ObjectManager.py, line 474, =
in=20
manage_delObjects
    (Object: Traversable)=20

It's like zope can't tell the difference between a comment and its contai=
ner?=20
Again, this leaves me well out of my depth!


Any advice would be most gratefully received,
regards,
Chris.