Thierry FLORAC wrote:
>   <page
>     name="images.html"
>     for=".interfaces.IGalleryFolder"
>     allowed_interface=".interfaces.IGalleryPhoto"
>     template=""
>     permission="zope.View"
>     class=".folder.FolderInfo"
>     menu="zmi_views" title="Images" />
> But when trying to display the view, a ForbiddenAttribute exception is
> raised :
>   File ".../browser/", line 39, in getImages
>     result.sort (lambda x,y:
>                  cmp(IGalleryPhoto(x).name,IGalleryPhoto(y).name))
>   ForbiddenAttribute:('sort',[<GalleryPhoto object at 0xa5b378ac>,...] 
> So the forbidden attribute seems to be the "sort" method of the
> resulting array, which of course isn't part of any of my interfaces.
> In such a case, I solved the problem by moving the "getSortedImages" to
> the folder interface and content class.
You have to define an empty getImages method on the interface.
> But that may not always be possible, so how can I get access to such
> methods ??
Why should it not be possible? After all, you defined the FolderInfo
view for the IGalleryFolder _Interface_, not the GalleryFolder class.

Zope3-users mailing list

Reply via email to