[ZPT] skip_unauthorized

Evan Simpson evan@zope.com
Mon, 13 Aug 2001 15:23:11 -0400


Thomas Olsen wrote:
> out how to implement skip_unauthorized as in:
> 
> <dtml-in expr="objectValues( [ 'Link','Favorite' ] )" skip_unauthorized>

With the just-released ZTUtils 1.1.0, you can do this:

<ul tal:define="ztu modules/ZTUtils;
                 objs python:here.objectValues(['Link', 'Favorite']);
                 authobjs python:ztu.LazyFilter(objs, skip='')">
<li tal:repeat="obj authobjs">

Cheers,

Evan @ Zope