On Thu, 2 Dec 2004 01:49:11 -0500, Paul Winkler <pw_lists@slinkp.com> wrote:
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.
Duh! You have a very valid point there ;) Just create standard folders and populate that through an interface of sorts. So I guess it'd be a couple of scripts to do the posting, and the product to do the comments and things...
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.
Ah, OK, I'll look at it. -- Phillip Hutchings http://www.sitharus.com/ sitharus@gmail.com / sitharus@sitharus.com