Comment 4 for bug 231106

Revision history for this message
Philipp von Weitershausen (philikon) wrote : Re: [Bug 231106] [NEW] grok.ViewletManager.render() overrides viewlet sort order

Good catch, JW. I have just two remarks about your patch:

* I understand having to sort twice (once using util.sort_components
to sort by the grok.order() and once by viewlet's name), but it may
not be obvious to everybody. Thus a comment explaining what this code
actually wants to do would be nice. By the way, I think the (index,
(name, viewlet)) tuple could be flat, i.e. (index, name, viewlet).
Then the list comprehension would also be a little more readable, i.e.
[name, viewlet for index, name, viewlet in sorted(indexed_viewlets)].

* It would be good if the default behaviour of first sorting by
grok.order(), then by viewlet name were tested. In other words, a test
that had two viewlets with the same grok.order() but different names
would be great to have.