[Twisted-Python] RFC - List hierarchies in Woven

Christopher Armstrong radix at twistedmatrix.com
Mon Aug 11 08:30:19 MDT 2003


On Mon, Aug 11, 2003 at 02:11:07AM -0400, Abe Fettig wrote:
> I'd like to get some feedback on this.  I'm not really happy with the
> hard-coded "children" attribute thing - if there's a more
> elegant/twistedish way of expressing a hierarchy of objects in Python
> I'd love to know about it.

Well, my first instinct would be move it into a completely separate
Widget class. Once that's done, I'd make the model, rather than a list
of things with .children attributes, just a list of lists. Also, some
extra patterns for more fine-grained control of how this thing gets
renderred would be nice, but I can't think of any now. 

I do have a need for something like this in Plonk, for the navigation
menu -- I'd like a hierarchy of links displayed rather than just a
contextual "current children" list. I'll try your patch (or something
like it) when I get around to implementing that, and I'll have much
better input then :)



-- 
 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/




More information about the Twisted-Python mailing list