[Zope] Re: problem with sort_order (when seting up zwikitracker)

Dieter Maurer dieter@handshake.de
Sun, 24 Feb 2002 18:52:37 +0100


Simon Michael writes:
 > Aaah! Don't expose my dtml quackery here!
 > 
 > 
 > Well, one or two others reported the same problem and I'd love to
 > understand it. How can
 > 
 >   _.getattr(REQUEST,'sort_order','')
 > 
 > ever give a KeyError ?
I think, this is because "ZPublisher.HTTPRequest.HTTPRequest.__getattr__" was
a bit carelessly mapped to the "__getitem__" method of this class
which does not have a default attribute.

When I remember right, I saw a post that this careless mapping was
fixed in recent Zope versions.

You may use "REQUEST.get".
I would prefer this anyway because "REQUEST" is basically a mapping.
Exposing its keys as attributes, too, is just a convenience.
As you experienced, it was not completely implemented.


Dieter