-----Original Message----- From: zope-bounces@zope.org [mailto:zope-bounces@zope.org]On Behalf Of Paul Winkler
On Thu, Aug 07, 2003 at 04:22:01PM -0400, Ron Bickers wrote:
If I define somevar as follows, which I commonly do:
define="somevar session/somevar | nothing"
Then yes, somevar will exist, but if it's 'nothing', it won't have a get method. That's when it will raise the exception if I use your code to check it.
Hmmm... Should I define somevar like this instead?
define="somevar session/somevar | python:{}"
maybe... sometimes... i dunno? i think i've reached the end of my ability to generalize about this topic :-)
Ok. I'm actually in the middle of working on a form-heavy site where this type of stuff is needed a lot, thus my interest in this in a non-generalized fashion. I changed my somevar definition as I suggested to myself above and used your simplified versions. All is working well and I like it much better. For the record and the archives... I just realized that in my examples I specified None as the optional second argument to get(), forgetting that None is the default, so it can be left out. Thanks for your input, Paul. _______________________ Ron Bickers Logic Etc, Inc.