[Zope3-dev] Testing for a view

Sidnei da Silva sidnei@x3ng.com
Tue, 4 Mar 2003 18:16:51 -0300


On Tue, Mar 04, 2003 at 04:06:08PM -0500, Casey Duncan wrote:
| On Tuesday 04 March 2003 03:24 pm, Sidnei da Silva wrote:
| > Howdy,
| > 
| > I just stumbled on a small thing that I think that could be easily
| > fixed, but I dont know if everyone would agree on this. Heres the
| > issue:
| > 
| > Currently, the metadata box on is rendered using a view for
| > dublincore. This view can be accessed using @@MetaDataBox. 
| > 
| > When testing for inclusion of the metadata box, the Z3 UI right now
| > tests does this:
| > 
| > .... 
| >      tal:define="view context/@@MetaDataBox"
| >      tal:condition="view">
| > ....
| > 
| > But theres a small problem in here. The metadata box is a page
| > template with a few conditions and if all those conditions evaluate to
| > false, this view will not return an empty string, but a string that
| > contains only spaces. From the Browser POV, a string that only
| > contains spaces is not very useful so, I propose:
| 
| Couldn't you just use:
| 
| tal:condition="view/strip"
| 
| To make a string that is all spaces evaluate false?

I think so, unless 'view' isnt a string. But Im almost sure it will be
most of the time.

[]'s
-- 
Sidnei da Silva (dreamcatcher) <sidnei@x3ng.com.br>
X3ng Web Technology <http://www.x3ng.com.br>
GNU/Linux user 257852
Debian GNU/Linux 3.0 (Sid) 2.4.18 ppc

Keep the number of passes in a compiler to a minimum.
		-- D. Gries