[Zope-CMF] How to get the main parent from a discussion item?

Ausum augusto@artlover.com
Wed, 25 Jul 2001 13:39:40 -0500


This is a workaround (any help is still appreciated):

    def the_parent( self, REQUEST=None ):
        current = self
        parent = self
        while parent.meta_type==self.meta_type:
            parent = current.inReplyTo()
            current = parent
        return current

To call its metadata:

<dtml-with the_parent>
   <dtml-var title>
  <dtml-var absolute_url>
  ......
</dtml-with>



Ausum



Ausum wrote:
>
> I'm trying to provide a link to the main parent (discussable documents,
> news, etc ) within all the discussions items resulting from it, no matter
> its nesting level.
> I've been trying to get into the aboveinThread.py script and the
> parentsInThread method trying to figure out a solution but I got stuck
> again.
> Would you please tell me what I'm doing wrong here?:
>
> def the_parent(self)
>         current = self
>         while parent.meta_type=self.meta_type:
>             parent = current.inReplyTo()
>             current = parent
>         return parent
>
> What would it be the DTML way?
>
> Thanks in advance,
>
> Ausum
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests