[ZPT] path variable doesn't exist

Justin Robertson nostrebornitsuj at hotmail.com
Tue Jan 20 04:12:59 EST 2004


What is the easy way to get round the error generated when a path variable 
that doesn't exist is referred to? I'm trying to detect an optional 
querystring argument, but when it's not there I get an error for referring 
to it.

This is the code that generates the error when one or both of cid and tid 
are not in the querystring.

<div tal:condition="python:request.cid and request.tid">
Only show me if cid and tid exist.
</div>

I understand that you can use:

<div tal:condition="request/cid | nothing>

to avoid this error when you have one expression, but how do you do that 
using a python expression?

thanks

J

_________________________________________________________________
Sign-up for a FREE BT Broadband connection today! 
http://www.msn.co.uk/specials/btbroadband




More information about the ZPT mailing list