Sorry, this code did not make sense. This code trys to traverse 'messageboardobject/messageobject/edit.html' also. I could access directly. I tried to reject only this by replacing else: to
elif string.find(name, 'editmine.html') == -1:
But, name value receives only 'messageobject' in this case, right? How can I reject only 'messageboardobject/messageobject/edit.html'
It looks there are smarter ways.

>     def publishTraverse(self, request, name):
>         if name == 'edit.html':
>             subob = self._guessTraverse(request, name)
>             if subob is not None:
>                view = zapi.queryMultiAdapter((subob, request),
>             name=name)
>                if view is not None:
>                    return view
>             raise NotFound(subob, name, request)
>
>         else:
>             subob = self.context.get(name, None)
>             if subob is None:
>                 view = zapi.queryMultiAdapter((self.context, request),
>             name=name)
>                 if view is not None:
>                     return view
>
>                 raise NotFound(self.context, name, request)
>
>             return subob

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to