[Zope] Constructing 'Friendly' URLs in products

Paul Winkler pw_lists at slinkp.com
Thu Dec 2 01:49:11 EST 2004


On Thu, Dec 02, 2004 at 03:52:02PM +1300, Phillip Hutchings wrote:
> solution? About the best I could come up with was chaining a series of
> persistant classes which subclass Item.Folder (iirc that's the one),
> sort of like this:
> Blog->BlogYear(id=2004)->BlogMonth(id=11)->BlogDay(id=04)->BlogPost(id=wow-zope-is-cool),
> just a containment hierarchy. Is this good or bad thinking? 

you could do that... although i suspect that for many of those you
could get by with standard Folder.

> I was also
> thinking of a single class that used something like __getattr__ to
> process a function or something, but I haven't though of how that
> would work. Probably like this myPosts =
> {'2004':{'11':{'04':{'wow-zope-is-cool':getBlogPost}}}}, but I'm not
> sure if that would even work.

Close.  define __bobo_traverse__(REQUEST, name) instead of 
__getattr__.  The latter is already heavily used by security
and acquisition and attempting to overload it is likely to
lead to pain and frustration.


-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope mailing list