[Grok-dev] Re: Question about viewlets

Wichert Akkerman wichert at wiggy.net
Thu May 1 17:29:45 EDT 2008


Previously Martijn Faassen wrote:
> Note that grok.order() is a bit more advanced than you might suspect at 
> first. The rules for grokcore.component.util.sort_components:
> 
> 1. if grok.order() is used explicitly with a numeric argument, that will 
> be used for sorting. Objects without explicit order will sort before this.
> 
> 2. if grok.order() is used without an argument, things are ordered in 
> definition order. If multiple modules are in play, they'll be sorted by 
> dotted module name.
> 
> 3. if grok.order() is altogether missing, unfortunately some python 
> limitations make it impossible to use implicit ordering as in 2. Instead 
>  we sort on class name to have at least some consistent ordering.

Perhaps a fallback on grok.title would be more logical, since you are
generating output for users instead of coders.

Wichert.

-- 
Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.


More information about the Grok-dev mailing list