The difference between getattr and restrictedTraverse

Tim Hicks tim at sitefusion.co.uk
Sun Jun 10 16:51:26 UTC 2007


Martin Aspeli wrote:

>> I take your point.  In response to your "why should a (weblog entry)
>> object 'know' what its display url is?", I'd say "because people expect
>> it to".  That is, 'absolute_url' is the recognised way of retrieving an
>> object's url.  In essence, my question to you might be "why should a
>> developer have to use a special API to get the appropriate url of an
>> object when there is a perfectly good, and widely-known, zope API method
>> already?".
> 
> Please. Do *not* try to re-define the meaning of absolute_url. It has a
> very specific purpose and meaning, and changing it would likely cause
> (a) confusion and (b) subtle breakage. I know it sounds "neat" that the
> pseuo-url is returned from "the" URL function, but it's not a good idea.
> Leave it alone. Please.

Ok, ok, I give in :).  The view approach does indeed seem to make more
sense.

Now, if only I could figure out the security error that manifests itself
in plone.portlets, Quills 1.6 would be good to go in the very near future...


Tim




More information about the Product-Developers mailing list