-----Original Message----- From: zope-bounces@zope.org [mailto:zope-bounces@zope.org]On Behalf Of Paul Winkler
<input type="checkbox" name="toppings:list" value="Pepperoni" tal:attributes="checked python:test('Pepperoni' in path('request/toppings | python:[]'), 'checked', nothing)" />
Not quite as elegant, but it's not horrible and it behaves as expected, yes?
nested python: expressions.... hmm... sorry to say that pushes it over the "horrible" mark for me :-\
I remember now why I used the path() function with a nested python expression instead of the get method... If you're using a variable other than 'request' (which we know will exist), you'll get an exception if that variable doesn't exist. The path() function handles this gracefully and returns nothing. So, how would you write the following more elegantly to handle when 'somevar' doesn't exist? "python:test('A' in path('somevar/letters' | python:[]'), 'checked', nothing)" _______________________ Ron Bickers Logic Etc, Inc.